@@ -172,21 +172,21 @@ public void TestBlanksInInlineSequences()
172172
173173 Assert . AreEqual (
174174@"1. a
175- 2.
175+ 2.
1761763. b
1771774. b
178178---
179- 1.
179+ 1.
1801802. a
1811813. a
182182---
1831831. a
184- 2.
185- 3.
184+ 2.
185+ 3.
186186---
187- 1.
188- 2.
189- 3.
187+ 1.
188+ 2.
189+ 3.
190190" . Replace ( "\r " , "" ) , story . ContinueMaximally ( ) . Replace ( "\r " , "" ) ) ;
191191 }
192192
@@ -240,7 +240,7 @@ public void TestChoiceDivertsToDone()
240240 Assert . AreEqual ( 1 , story . currentChoices . Count ) ;
241241 story . ChooseChoiceIndex ( 0 ) ;
242242
243- Assert . AreEqual ( "choice\n " , story . Continue ( ) ) ;
243+ Assert . AreEqual ( "choice" , story . Continue ( ) ) ;
244244 Assert . IsFalse ( story . hasError ) ;
245245 }
246246
@@ -818,7 +818,7 @@ EXTERNAL times(i,str)
818818
819819 Assert . AreEqual ( "15\n " , story . Continue ( ) ) ;
820820
821- Assert . AreEqual ( "knock knock knock \n " , story . Continue ( ) ) ;
821+ Assert . AreEqual ( "knock knock knock\n " , story . Continue ( ) ) ;
822822
823823 Assert . AreEqual ( "MESSAGE: hello world" , message ) ;
824824 }
@@ -1034,7 +1034,7 @@ public void TestImplicitInlineGlueB ()
10341034}
10351035" ) ;
10361036
1037- Assert . AreEqual ( "A \n X\n " , story . ContinueMaximally ( ) ) ;
1037+ Assert . AreEqual ( "A\n X\n " , story . ContinueMaximally ( ) ) ;
10381038 }
10391039
10401040 [ Test ( ) ]
@@ -1370,8 +1370,7 @@ public void TestNonTextInChoiceInnerContent()
13701370 story . Continue ( ) ;
13711371
13721372 story . ChooseChoiceIndex ( 0 ) ;
1373- Assert . AreEqual ( "option text. Conditional bit.\n " , story . Continue ( ) ) ;
1374- Assert . AreEqual ( "Next.\n " , story . Continue ( ) ) ;
1373+ Assert . AreEqual ( "option text. Conditional bit. Next.\n " , story . Continue ( ) ) ;
13751374 }
13761375
13771376 [ Test ( ) ]
@@ -1829,10 +1828,10 @@ public void TestStringsInChoices()
18291828 story . ContinueMaximally ( ) ;
18301829
18311830 Assert . AreEqual ( 1 , story . currentChoices . Count ) ;
1832- Assert . AreEqual ( @" test1 ""test2 test3""" , story . currentChoices [ 0 ] . text ) ;
1831+ Assert . AreEqual ( @"test1 ""test2 test3""" , story . currentChoices [ 0 ] . text ) ;
18331832
18341833 story . ChooseChoiceIndex ( 0 ) ;
1835- Assert . AreEqual ( " test1 test4\n " , story . Continue ( ) ) ;
1834+ Assert . AreEqual ( "test1 test4\n " , story . Continue ( ) ) ;
18361835 }
18371836
18381837 [ Test ( ) ]
@@ -2413,10 +2412,10 @@ public void TestTempUsageInOptions ()
24132412 story . Continue ( ) ;
24142413
24152414 Assert . AreEqual ( 1 , story . currentChoices . Count ) ;
2416- Assert . AreEqual ( " 1" , story . currentChoices [ 0 ] . text ) ;
2415+ Assert . AreEqual ( "1" , story . currentChoices [ 0 ] . text ) ;
24172416 story . ChooseChoiceIndex ( 0 ) ;
24182417
2419- Assert . AreEqual ( " 1\n End of choice\n this another\n " , story . ContinueMaximally ( ) ) ;
2418+ Assert . AreEqual ( "1\n End of choice\n this another\n " , story . ContinueMaximally ( ) ) ;
24202419
24212420 Assert . AreEqual ( 0 , story . currentChoices . Count ) ;
24222421 }
@@ -3048,7 +3047,7 @@ public void TestTagOnChoice ()
30483047 var txt = story . Continue ( ) ;
30493048 var tags = story . currentTags ;
30503049
3051- Assert . AreEqual ( " Hello\n " , txt ) ; // argh need to fix space?
3050+ Assert . AreEqual ( "Hello" , txt ) ;
30523051 Assert . AreEqual ( 1 , tags . Count ) ;
30533052 Assert . AreEqual ( "hey" , tags [ 0 ] ) ;
30543053 }
@@ -3145,23 +3144,6 @@ In top external
31453144 }
31463145
31473146
3148-
3149- [ Test ( ) ]
3150- public void TestStartingLineWithEscapedWhitespace ( )
3151- {
3152- var storyStr =
3153- @"
3154- hello{1:
3155- \ world
3156- }
3157- " ;
3158-
3159- var story = CompileString ( storyStr ) ;
3160-
3161- Assert . AreEqual ( "hello\n world\n " , story . ContinueMaximally ( ) ) ;
3162- }
3163-
3164-
31653147 [ Test ( ) ]
31663148 public void TestNewlinesWithStringEval ( )
31673149 {
@@ -3343,6 +3325,47 @@ public void TestTopFlowTerminatorShouldntKillThreadChoices ()
33433325 }
33443326
33453327
3328+ [ Test ( ) ]
3329+ public void TestNewlineConsistency ( )
3330+ {
3331+ var storyStr =
3332+ @"
3333+ hello -> world
3334+ == world
3335+ world
3336+ -> END" ;
3337+
3338+ var story = CompileString ( storyStr ) ;
3339+ Assert . AreEqual ( "hello world\n " , story . ContinueMaximally ( ) ) ;
3340+
3341+ storyStr =
3342+ @"
3343+ * hello -> world
3344+ == world
3345+ world
3346+ -> END" ;
3347+ story = CompileString ( storyStr ) ;
3348+
3349+ story . Continue ( ) ;
3350+ story . ChooseChoiceIndex ( 0 ) ;
3351+ Assert . AreEqual ( "hello world\n " , story . ContinueMaximally ( ) ) ;
3352+
3353+
3354+ storyStr =
3355+ @"
3356+ * hello
3357+ -> world
3358+ == world
3359+ world
3360+ -> END" ;
3361+ story = CompileString ( storyStr ) ;
3362+
3363+ story . Continue ( ) ;
3364+ story . ChooseChoiceIndex ( 0 ) ;
3365+ Assert . AreEqual ( "hello\n world\n " , story . ContinueMaximally ( ) ) ;
3366+ }
3367+
3368+
33463369 // Helper compile function
33473370 protected Story CompileString ( string str , bool countAllVisits = false , bool testingErrors = false )
33483371 {
0 commit comments