mirror of
https://github.com/Oreolek/ink-instead.git
synced 2024-06-16 15:10:48 +03:00
branching test
This commit is contained in:
parent
e9909003b0
commit
f978875905
|
@ -1,14 +1,25 @@
|
|||
=== start ===
|
||||
=== back_in_london ===
|
||||
|
||||
"What that's?" my master asked.
|
||||
* "I am somewhat tired[."]," I repeated.
|
||||
"Really," he responded. "How deleterious."
|
||||
* "Nothing, Monsieur!"[] I replied.
|
||||
"Very good, then."
|
||||
-> finale
|
||||
* "I said, this journey is appalling[."] and I want no more of it."
|
||||
"Ah," he replied, not unkindly. "I see you are feeling frustrated. Tomorrow, things will improve."
|
||||
* [Leave] -> finale
|
||||
We arrived into London at 9.45pm exactly.
|
||||
|
||||
=== finale ===
|
||||
Bye
|
||||
* "There is not a moment to lose!"[] I declared.
|
||||
-> hurry_outside
|
||||
|
||||
* "Monsieur, let us savour this moment!"[] I declared.
|
||||
My master clouted me firmly around the head and dragged me out of the door.
|
||||
-> dragged_outside
|
||||
|
||||
* [We hurried home] -> hurry_outside
|
||||
|
||||
|
||||
=== hurry_outside ===
|
||||
We hurried home to Savile Row -> as_fast_as_we_could
|
||||
|
||||
|
||||
=== dragged_outside ===
|
||||
He insisted that we hurried home to Savile Row
|
||||
-> as_fast_as_we_could
|
||||
|
||||
|
||||
=== as_fast_as_we_could ===
|
||||
<> as fast as we could.
|
||||
|
|
1
test.lua
1
test.lua
|
@ -23,6 +23,7 @@ function testChoices() doTest('choices') end
|
|||
function testNest() doTest('nested') end
|
||||
function testNest2() doTest('nested2') end
|
||||
function testKnot() doTest('knot') end
|
||||
function testBranching() doTest('branching') end
|
||||
|
||||
|
||||
|
||||
|
|
71
test/branching.lua
Normal file
71
test/branching.lua
Normal file
|
@ -0,0 +1,71 @@
|
|||
return {
|
||||
ink=[[
|
||||
=== back_in_london ===
|
||||
|
||||
We arrived into London at 9.45pm exactly.
|
||||
|
||||
* "There is not a moment to lose!"[] I declared.
|
||||
-> hurry_outside
|
||||
|
||||
* "Monsieur, let us savour this moment!"[] I declared.
|
||||
My master clouted me firmly around the head and dragged me out of the door.
|
||||
-> dragged_outside
|
||||
|
||||
* [We hurried home] -> hurry_outside
|
||||
|
||||
|
||||
=== hurry_outside ===
|
||||
We hurried home to Savile Row -> as_fast_as_we_could
|
||||
|
||||
|
||||
=== dragged_outside ===
|
||||
He insisted that we hurried home to Savile Row
|
||||
-> as_fast_as_we_could
|
||||
|
||||
|
||||
=== as_fast_as_we_could ===
|
||||
<> as fast as we could.
|
||||
]],
|
||||
expected= {
|
||||
{
|
||||
"knot",
|
||||
"back_in_london",
|
||||
{"para", "We arrived into London at 9.45pm exactly."},
|
||||
{
|
||||
"choice",
|
||||
{
|
||||
"option",
|
||||
'"There is not a moment to lose!"',
|
||||
"",
|
||||
" I declared.",
|
||||
{"divert", "hurry_outside"}
|
||||
},
|
||||
{
|
||||
"option",
|
||||
'"Monsieur, let us savour this moment!"',
|
||||
"",
|
||||
" I declared.",
|
||||
{
|
||||
"para",
|
||||
"My master clouted me firmly around the head and dragged me out of the door."
|
||||
},
|
||||
{"divert", "dragged_outside"}
|
||||
},
|
||||
{"option", "", "We hurried home", " ", {"divert", "hurry_outside"}}
|
||||
}
|
||||
},
|
||||
{
|
||||
"knot",
|
||||
"hurry_outside",
|
||||
{"para", "We hurried home to Savile Row "},
|
||||
{"divert", "as_fast_as_we_could"}
|
||||
},
|
||||
{
|
||||
"knot",
|
||||
"dragged_outside",
|
||||
{"para", "He insisted that we hurried home to Savile Row"},
|
||||
{"divert", "as_fast_as_we_could"}
|
||||
},
|
||||
{"knot", "as_fast_as_we_could", "glue", {"para", "as fast as we could."}}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue