test for switch