Added unit test for q2r function