Add unit test for code generation of logical expressions