You're right. I think there should be at least two tests: one ensuring the keystroke is prevented from propagating when the flag is on and another ensuring the opposite.