summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2012-02-08 00:24:06 -0700
committerMike Buland <eichlan@xagasoft.com>2012-02-08 00:24:06 -0700
commita859a39f3455fcbf0575bd7acd25915c40922f92 (patch)
tree709c900083529913c45e782c430eec82dba9e642 /tests
parent11554a9e5c92a98129b42598495abe7503d9208c (diff)
downloadstage-a859a39f3455fcbf0575bd7acd25915c40922f92.tar.gz
stage-a859a39f3455fcbf0575bd7acd25915c40922f92.tar.bz2
stage-a859a39f3455fcbf0575bd7acd25915c40922f92.tar.xz
stage-a859a39f3455fcbf0575bd7acd25915c40922f92.zip
Committed the tests I've been using.0.05
Good for regressions, I'll have to make some sort of test suite thing later.
Diffstat (limited to 'tests')
-rw-r--r--tests/g.stage36
-rw-r--r--tests/i.stage17
-rw-r--r--tests/l.stage32
-rw-r--r--tests/opttest.stage18
-rw-r--r--tests/r.stage24
-rw-r--r--tests/t.stage29
-rw-r--r--tests/test.stage35
7 files changed, 191 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 @@
1situation <<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
15function a()
16{
17 display("pre a");
18 b();
19 display("post a");
20}
21
22function b()
23{
24 display("pre b");
25 goto( <<2>> );
26 display("post b");
27}
28
29situation <<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 @@
1situation <<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 @@
1situation <<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
26situation <<b>>
27{
28 enter
29 {
30 display("b!");
31 }
32}
diff --git a/tests/opttest.stage b/tests/opttest.stage
new file mode 100644
index 0000000..325a197
--- /dev/null
+++ b/tests/opttest.stage
@@ -0,0 +1,18 @@
1option situation <<start>>
2{
3 option: "Begin the game"
4 {
5 display("the game has begun.");
6 }
7
8 option: "I'm not ready yet"
9 {
10 display("Yup, that's what I thought.");
11 }
12
13 option: "Quit the game"
14 {
15 display("Ok...fine...");
16 exit();
17 }
18}
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
2game.start = <<a>>;
3
4situation <<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
18function 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
2situation <<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
16function goAhead()
17{
18 display("goAhead() pre");
19 goto( <<next>> );
20 display("goAhead() post");
21}
22
23situation <<next>>
24{
25 enter
26 {
27 display("This is next.");
28 }
29}
diff --git a/tests/test.stage b/tests/test.stage
new file mode 100644
index 0000000..cc765a4
--- /dev/null
+++ b/tests/test.stage
@@ -0,0 +1,35 @@
1
2game.title = "Code Test";
3game.author = "Mike Buland";
4game.version = 1;
5game.revision = 0;
6game.start = <<start>>;
7
8global
9{
10 command: "exit"
11 {
12 exit();
13 }
14}
15
16function getVal()
17{
18 global.stuff = {'hi': 5 };
19}
20
21situation <<start>>
22{
23 setup
24 {
25 if true then
26 {
27 getVal();
28 }
29 }
30
31 enter
32 {
33 }
34}
35