From 69e4a21f71aca4954469063387063434af35e679 Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Sun, 25 Oct 2026 10:24:58 -0700 Subject: Backport a few missing guard checks --- .../java/com/seaofnodes/simple/ConstructionTest.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'chapter27/src/test/java/com/seaofnodes/simple/ConstructionTest.java') diff --git a/chapter27/src/test/java/com/seaofnodes/simple/ConstructionTest.java b/chapter27/src/test/java/com/seaofnodes/simple/ConstructionTest.java index dd20b746..a3317d09 100644 --- a/chapter27/src/test/java/com/seaofnodes/simple/ConstructionTest.java +++ b/chapter27/src/test/java/com/seaofnodes/simple/ConstructionTest.java @@ -7,6 +7,23 @@ import org.junit.Test; import static org.junit.Assert.*; public class ConstructionTest { + @Test public void testConditionalConstructorLoop() { + String[] bodies = { + "while(n--) if(n) x=1;", + "for(int i=0;i