Skip to content

Commit

Permalink
Added first ink proof test
Browse files Browse the repository at this point in the history
  • Loading branch information
bladecoder committed Nov 12, 2023
1 parent ce27f56 commit 22e988d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/test/java/com/bladecoder/ink/runtime/test/MiscTest.java
Expand Up @@ -27,4 +27,13 @@ public void issue15() throws Exception {
}
}
}

@Test
public void testNewlinesWithStringEval() throws Exception {

String json = TestUtils.getJsonString("inkfiles/misc/newlines_with_string_eval.ink.json");
Story story = new Story(json);

Assert.assertEquals("A\n3\nB\n", story.continueMaximally());
}
}
@@ -0,0 +1,9 @@
//A
//~temp someTemp = string()
//B
A
{string()}
B
=== function string()
~ return "{3}"
}
@@ -0,0 +1 @@
{"inkVersion":21,"root":[["^A","\n","ev",{"f()":"string"},"out","/ev","\n","^B","\n",["done",{"#f":5,"#n":"g-0"}],null],"done",{"string":["ev","str","ev",3,"out","/ev","/str","/ev","~ret",{"#f":1}],"#f":1}],"listDefs":{}}

0 comments on commit 22e988d

Please sign in to comment.