Hi there, you are in luck I just revised this myself yesterday!! The swinging torch test is used to test for afferent or efferent pupillary defects.
For example, I am examining the Right eye for a problem:
I literally shine my torch into the right pupil then the left pupil and then back to the right eye again.
When you shine the torch into the right eye first time it should constrict. (Direct response intact)
When you shine the light into the left eye, the right eye should constrict.
(Consensual response intact)
However, If the right pupil DILATES when I shine my torch into it the second time, then there is a problem and it is with the afferent pathway e.g. the retina or the optic nerve.
An efferent lesion can be detected when the right eye I am testing has no direct or consensual response and the left eye has an intact direct and consensual response.
I hope this helps