From a080ea0774887141c26e38e57355e5520c49396a Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Wed, 17 Jul 2024 18:11:56 +0100 Subject: Chapter 12: Floats Co-authored-by: Dibyendu Majumdar Co-authored-by: Thalia Archibald Co-authored-by: XmiliaH <45106915+XmiliaH@users.noreply.github.com> Co-authored-by: Robert Obkircher --- .../java/com/seaofnodes/simple/Chapter11Test.java | 42 +++------------------- 1 file changed, 4 insertions(+), 38 deletions(-) (limited to 'src/test/java/com/seaofnodes/simple/Chapter11Test.java') diff --git a/src/test/java/com/seaofnodes/simple/Chapter11Test.java b/src/test/java/com/seaofnodes/simple/Chapter11Test.java index fdf56b56..a8b09226 100644 --- a/src/test/java/com/seaofnodes/simple/Chapter11Test.java +++ b/src/test/java/com/seaofnodes/simple/Chapter11Test.java @@ -292,7 +292,7 @@ else { } """); StopNode stop = parser.parse().iterate(); - assertEquals("Stop[ return 9; return 0; return 0; ]", stop.toString()); + assertEquals("Stop[ return 9; return 0; return 0; return 0; return 0; ]", stop.toString()); } @@ -434,7 +434,7 @@ while(1) arg = arg+ptr.v; """); StopNode stop = parser.parse().iterate(); - assertEquals("return 0;", stop.toString()); + assertEquals("Stop[ return 0; return 0; ]", stop.toString()); } @Test @@ -496,7 +496,7 @@ return v; @Test public void testExample2() { Parser parser = new Parser( - """ + """ struct S { int f; } S v = new S; int i = arg; @@ -507,7 +507,7 @@ while (arg > 0) { arg = arg - 1; } return v; -"""); + """); StopNode stop = parser.parse().iterate(); //assertEquals("return new S;", stop.toString()); } @@ -528,38 +528,4 @@ return s.f; assertEquals(1L, Evaluator.evaluate(stop, 1)); assertEquals(0L, Evaluator.evaluate(stop, 2)); } - - @Test - public void testScheduleUse() { - Parser parser = new Parser( -""" -int v0=0; -while(0>=0) { - int v1=0; - v1=v0; - if(v1*0) - v0=-v1; -} -return 0; -"""); - StopNode stop = parser.parse().iterate(); - assertEquals("return 0;", stop.toString()); - } - - @Test - public void testLoopCarriedDep() { - Parser parser = new Parser( -""" -int v0=0; -{ - int v1=0; - while(v1) { - v1=1+(v0!=0); - v0=v1/0; - } -} -"""); - StopNode stop = parser.parse().iterate(); - assertEquals("return 0;", stop.toString()); - } } -- cgit v1.2.3