package com.seaofnodes.simple; import com.seaofnodes.simple.node.*; import com.seaofnodes.simple.type.TypeInteger; import org.junit.Test; import static org.junit.Assert.*; public class Chapter06Test { @Test public void testPeepholeReturn() { Parser parser = new Parser( """ if( true ) return 2; return 1; """); StopNode stop = parser.parse(false); assertEquals("return 2;", stop.toString()); assertTrue(stop.ret().ctrl() instanceof ProjNode); } @Test public void testPeepholeRotate() { Parser parser = new Parser( """ int a = 1; if (arg) a = 2; return (arg < a) < 3; """); StopNode stop = parser.parse(false); assertEquals("return ((arg