unit test and fix negation operator