diff options
| author | Cliff Click <cliffc@acm.org> | 2024-09-30 11:40:36 -0700 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2024-10-06 08:56:22 -0700 |
| commit | 10cf538245658e6491ed6a85727ab0c64446ad86 (patch) | |
| tree | 64b1b93a9cd5b170b709c246d8cf9a14e93dbf3a /chapter15/src/test/java/com | |
| parent | bffc1eec124df7fa4de72c8b0fe48b7ec048da44 (diff) | |
| download | Simple-10cf538245658e6491ed6a85727ab0c64446ad86.tar.gz Simple-10cf538245658e6491ed6a85727ab0c64446ad86.zip | |
store-store opt checks offset
Diffstat (limited to 'chapter15/src/test/java/com')
| -rw-r--r-- | chapter15/src/test/java/com/seaofnodes/simple/Chapter15Test.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/chapter15/src/test/java/com/seaofnodes/simple/Chapter15Test.java b/chapter15/src/test/java/com/seaofnodes/simple/Chapter15Test.java index f08abed0..6ba6eed4 100644 --- a/chapter15/src/test/java/com/seaofnodes/simple/Chapter15Test.java +++ b/chapter15/src/test/java/com/seaofnodes/simple/Chapter15Test.java @@ -47,6 +47,20 @@ return is[1]; } @Test + public void testBasic3() { + Parser parser = new Parser( +""" +int[] a = new int[2]; +a[0] = 1; +a[1] = 2; +return a[0]; +"""); + StopNode stop = parser.parse(false).iterate(true); + assertEquals("return .[];", stop.toString()); + assertEquals(1L, Evaluator.evaluate(stop, 0)); + } + + @Test public void testRollingSum() { Parser parser = new Parser( """ |
