To check the switch, jumper the two terminals. The light should come on. Hydraulic pressure turns the switch on when you depress the rear brake.
http://www.bikebandit.com/houseofmotorcycles/triumph-motorcycle-america/o/m6886Here is a link to the switch at BikeBandit. Click on "control and brake" then "rear brake master cylinder". The part is #25. Make sure it fits your bike if you need it because because it is serial number sensitive.