package com.seaofnodes.simple; import com.seaofnodes.simple.codegen.CodeGen; import com.seaofnodes.simple.type.TypeInteger; import org.junit.Test; import static org.junit.Assert.*; public class ChainedComparisonTest { @Test public void testAdjacentOperandsAndOperators() { String[] expressions = {"10 < arg < 20", "0 < arg <= 3", "3 >= arg > 0", "0 <= arg < 3", "0 < arg <= 3 < 4"}; String[][] expected = {{"0","0","1","0"}, {"0","1","0","0"}, {"0","1","0","0"}, {"1","0","0","0"}, {"0","1","0","0"}}; int[] args = {0,3,15,30}; for(int i=0;i 1;").parse(); fail("mixed directions"); } catch(RuntimeException e) { assertEquals("Mixing relational directions in a chained relational test",e.getMessage()); } } }