diff options
Diffstat (limited to '')
-rw-r--r-- | tests/g.stage | 36 | ||||
-rw-r--r-- | tests/i.stage | 17 | ||||
-rw-r--r-- | tests/l.stage | 32 | ||||
-rw-r--r-- | tests/opttest.stage (renamed from opttest.stage) | 0 | ||||
-rw-r--r-- | tests/r.stage | 24 | ||||
-rw-r--r-- | tests/t.stage | 29 | ||||
-rw-r--r-- | tests/test.stage (renamed from test.stage) | 0 |
7 files changed, 138 insertions, 0 deletions
diff --git a/tests/g.stage b/tests/g.stage new file mode 100644 index 0000000..05ca5ad --- /dev/null +++ b/tests/g.stage | |||
@@ -0,0 +1,36 @@ | |||
1 | situation <<start>> | ||
2 | { | ||
3 | setup | ||
4 | { | ||
5 | display("pre start"); | ||
6 | a(); | ||
7 | display("post start"); | ||
8 | } | ||
9 | enter | ||
10 | { | ||
11 | display("Start::Enter"); | ||
12 | } | ||
13 | } | ||
14 | |||
15 | function a() | ||
16 | { | ||
17 | display("pre a"); | ||
18 | b(); | ||
19 | display("post a"); | ||
20 | } | ||
21 | |||
22 | function b() | ||
23 | { | ||
24 | display("pre b"); | ||
25 | goto( <<2>> ); | ||
26 | display("post b"); | ||
27 | } | ||
28 | |||
29 | situation <<2>> | ||
30 | { | ||
31 | enter | ||
32 | { | ||
33 | display("pre 2"); | ||
34 | } | ||
35 | } | ||
36 | |||
diff --git a/tests/i.stage b/tests/i.stage new file mode 100644 index 0000000..8c2e7fe --- /dev/null +++ b/tests/i.stage | |||
@@ -0,0 +1,17 @@ | |||
1 | situation <<start>> | ||
2 | { | ||
3 | enter | ||
4 | { | ||
5 | if true then | ||
6 | { | ||
7 | display("True"); | ||
8 | } | ||
9 | else | ||
10 | { | ||
11 | display("False"); | ||
12 | } | ||
13 | |||
14 | display("Done"); | ||
15 | } | ||
16 | } | ||
17 | |||
diff --git a/tests/l.stage b/tests/l.stage new file mode 100644 index 0000000..4c2b8e1 --- /dev/null +++ b/tests/l.stage | |||
@@ -0,0 +1,32 @@ | |||
1 | situation <<start>> | ||
2 | { | ||
3 | enter | ||
4 | { | ||
5 | x = 5; | ||
6 | while x > 0 do | ||
7 | { | ||
8 | display( x ); | ||
9 | x-=1; | ||
10 | } | ||
11 | |||
12 | for each j in [1, 2, 4, 8, 16, 32] do | ||
13 | { | ||
14 | display( j ); | ||
15 | |||
16 | if j == 16 then | ||
17 | { | ||
18 | goto(<<b>>); | ||
19 | } | ||
20 | } | ||
21 | |||
22 | display("Hiya"); | ||
23 | } | ||
24 | } | ||
25 | |||
26 | situation <<b>> | ||
27 | { | ||
28 | enter | ||
29 | { | ||
30 | display("b!"); | ||
31 | } | ||
32 | } | ||
diff --git a/opttest.stage b/tests/opttest.stage index 325a197..325a197 100644 --- a/opttest.stage +++ b/tests/opttest.stage | |||
diff --git a/tests/r.stage b/tests/r.stage new file mode 100644 index 0000000..c2d9e1f --- /dev/null +++ b/tests/r.stage | |||
@@ -0,0 +1,24 @@ | |||
1 | |||
2 | game.start = <<a>>; | ||
3 | |||
4 | situation <<a>> | ||
5 | { | ||
6 | setup | ||
7 | { | ||
8 | x = 3; | ||
9 | |||
10 | my_fun( x ); | ||
11 | |||
12 | display("About to end" + x); | ||
13 | |||
14 | exit(); | ||
15 | } | ||
16 | } | ||
17 | |||
18 | function my_fun( a ) | ||
19 | { | ||
20 | display( a ); | ||
21 | return(); | ||
22 | display( "hello" ); | ||
23 | } | ||
24 | |||
diff --git a/tests/t.stage b/tests/t.stage new file mode 100644 index 0000000..c97fe4f --- /dev/null +++ b/tests/t.stage | |||
@@ -0,0 +1,29 @@ | |||
1 | |||
2 | situation <<start>> | ||
3 | { | ||
4 | setup | ||
5 | { | ||
6 | display("Hi"); | ||
7 | } | ||
8 | enter | ||
9 | { | ||
10 | display("start pre"); | ||
11 | goAhead(); | ||
12 | display("start post"); | ||
13 | } | ||
14 | } | ||
15 | |||
16 | function goAhead() | ||
17 | { | ||
18 | display("goAhead() pre"); | ||
19 | goto( <<next>> ); | ||
20 | display("goAhead() post"); | ||
21 | } | ||
22 | |||
23 | situation <<next>> | ||
24 | { | ||
25 | enter | ||
26 | { | ||
27 | display("This is next."); | ||
28 | } | ||
29 | } | ||
diff --git a/test.stage b/tests/test.stage index cc765a4..cc765a4 100644 --- a/test.stage +++ b/tests/test.stage | |||