unit test for if reduction