The swinging-flashlight test is used to help a practitioner identify a relative afferent pupillary defect.
For an adequate test, vision must not be entirely lost. In dim room light, the examiner notes the size of the pupils. The patient is asked to gaze into the distance, and the examiner swings the beam of a penlight back and forth from one pupil to the other, and observes the size of pupils and reaction in the eye that is lit.