How do I test that proximity sensor on Galaxy Nexus works as expected
Install a sensor app like AndroSens or AndroSensor.

They both are able to show you the proximity information.

Note:
The sensor only distinguishes between near and far proximity (0-5cm and >=5cm usually). It is OK that you won't get accurate distance measurements.