From e133af83d6654c1c13b4bb59aa8855a87c7a17c7 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Sun, 17 Mar 2019 17:20:28 -0600 Subject: [PATCH] Test fallback choice parsing --- examples/parsing/misc.hank | 4 +++- tests/ParserTest.hx | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/parsing/misc.hank b/examples/parsing/misc.hank index 837868d..843ec8e 100644 --- a/examples/parsing/misc.hank +++ b/examples/parsing/misc.hank @@ -31,4 +31,6 @@ var test2 = 5; --(labeled) deep gather * Simplest possible choice -++ {condition} Choice that ends with a divert -> target \ No newline at end of file +++ {condition} Choice that ends with a divert -> target +* ->fallback_choice +* -> \ No newline at end of file diff --git a/tests/ParserTest.hx b/tests/ParserTest.hx index b544be7..2e79ef2 100644 --- a/tests/ParserTest.hx +++ b/tests/ParserTest.hx @@ -106,5 +106,7 @@ class ParserTest extends utest.Test { assertNextExpr(EChoice(0, true, None, None, 1, new Output([Text("Simplest possible choice")]),None)); assertNextExpr(EChoice(1, false, None, Some("condition"), 2, new Output([Text("Choice that ends with a divert")]),Some("target"))); + assertNextExpr(EChoice(2, true, None, None, 1, new Output([]),Some("fallback_choice"))); + assertNextExpr(EChoice(3, true, None, None, 1, new Output([]),Some(""))); } } \ No newline at end of file