The oil light is a low pressure warning, but the switches are prone to failing, so it is nearly always a failed switch when the oil light comes on when running.
The revving it up test that you conducted is a good one as it will tell you if you actually do have low oil pressure when the engine seizes with a bang.... Or you could wait until you have replaced the switch before running it again.
__________________
|