add test case for setting state in Parser

-add test case for setting state in Parser