code and tests for exposing own king to check