wrote a test case for square_state.