summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAkira TAGOH <akira@tagoh.org>2006-09-24 05:31:37 +0000
committerAkira TAGOH <akira@tagoh.org>2006-09-24 05:31:37 +0000
commit77d44e8705d55e9bb32f76c2413e584a1feb7fc0 (patch)
treeee1531b1b25ea5f37067fd9801c75d7ba7b49f27 /tests
parent6aa9bc52d09dfe70f6605950a6f76cb0d9524605 (diff)
* tests/ps/test-and.ps:
* tests/ps/test-array.ps: * tests/ps/test-astore.ps: * tests/ps/test-atan.ps: * tests/ps/test-begin.ps: * tests/ps/test-bind.ps: * tests/ps/test-bitshift.ps: new testcases.
Diffstat (limited to 'tests')
-rw-r--r--tests/ps/test-aload.ps1
-rw-r--r--tests/ps/test-anchorsearch.ps3
-rw-r--r--tests/ps/test-and.ps21
-rw-r--r--tests/ps/test-array.ps11
-rw-r--r--tests/ps/test-astore.ps13
-rw-r--r--tests/ps/test-atan.ps16
-rw-r--r--tests/ps/test-begin.ps9
-rw-r--r--tests/ps/test-bind.ps9
-rw-r--r--tests/ps/test-bitshift.ps13
9 files changed, 96 insertions, 0 deletions
diff --git a/tests/ps/test-aload.ps b/tests/ps/test-aload.ps
index c24bb64..284f656 100644
--- a/tests/ps/test-aload.ps
+++ b/tests/ps/test-aload.ps
@@ -4,6 +4,7 @@ true /aload [[/arraytype /proctype]] typecheck
false /aload [[/booleantype /integertype /realtype /nametype /stringtype /dicttype /nulltype /marktype /operatortype /marktype /filetype /savetype]] typecheck
[] /stackunderflow true initunittestdict {aload} unittest
+[[1 2 3]] /invalidaccess true initunittestdict {[1 2 3] noaccess aload} unittest
[1 2 3 [1 2 3]] null true initunittestdict {[1 2 3] aload} unittest
[23 (ab) -6 [23 (ab) -6]] null true initunittestdict {[23 (ab) -6] aload} unittest
[23 (ab) -6 {23 (ab) -6}] null true initunittestdict {{23 (ab) -6} aload} unittest
diff --git a/tests/ps/test-anchorsearch.ps b/tests/ps/test-anchorsearch.ps
index d58f740..9613455 100644
--- a/tests/ps/test-anchorsearch.ps
+++ b/tests/ps/test-anchorsearch.ps
@@ -5,6 +5,9 @@ false /anchorsearch [[/booleantype /integertype /realtype /nametype /arraytype /
[] /stackunderflow true initunittestdict {anchorsearch} unittest
[(foo)] /stackunderflow true initunittestdict {(foo) anchorsearch} unittest
+[(abbc) (ab)] /invalidaccess true initunittestdict {(abbc) noaccess (ab) anchorsearch} unittest
+[(abbc) (ab)] /invalidaccess true initunittestdict {(abbc) (ab) noaccess anchorsearch} unittest
+[(abbc) (ab)] /invalidaccess true initunittestdict {(abbc) noaccess (ab) noaccess anchorsearch} unittest
[(bc) (ab) true] null true initunittestdict {(abbc) (ab) anchorsearch} unittest
[(abbc) false] null true initunittestdict {(abbc) (bb) anchorsearch} unittest
[(abbc) false] null true initunittestdict {(abbc) (bc) anchorsearch} unittest
diff --git a/tests/ps/test-and.ps b/tests/ps/test-and.ps
new file mode 100644
index 0000000..33d16e8
--- /dev/null
+++ b/tests/ps/test-and.ps
@@ -0,0 +1,21 @@
+initunittest
+
+true /and [[/booleantype] dup] typecheck
+true /and [[/integertype] dup] typecheck
+false /and [[/realtype /nametype /arraytype /stringtype /dicttype /nulltype /operatortype /marktype /filetype /savetype /proctype] dup] typecheck
+false /and [[/booleantype] [/integertype /realtype /nametype /arraytype /stringtype /dicttype /nulltype /operatortype /marktype /filetype /savetype /proctype]] typecheck
+false /and [[/integertype] [/booleantype /realtype /nametype /arraytype /stringtype /dicttype /nulltype /operatortype /marktype /filetype /savetype /proctype]] typecheck
+false /and [[/integertype /realtype /nametype /arraytype /stringtype /dicttype /nulltype /operatortype /marktype /filetype /savetype /proctype] [/booleantype]] typecheck
+false /and [[/booleantype /realtype /nametype /arraytype /stringtype /dicttype /nulltype /operatortype /marktype /filetype /savetype /proctype] [/integertype]] typecheck
+
+[] /stackunderflow true initunittestdict {and} unittest
+[1] /stackunderflow true initunittestdict {1 and} unittest
+clear
+[true] null true initunittestdict {true true and} unittest
+[false] null true initunittestdict {true false and} unittest
+[false] null true initunittestdict {false true and} unittest
+[false] null true initunittestdict {false false and} unittest
+[1] null true initunittestdict {99 1 and} unittest
+[4] null true initunittestdict {52 7 and} unittest
+
+unittestresult
diff --git a/tests/ps/test-array.ps b/tests/ps/test-array.ps
new file mode 100644
index 0000000..20782af
--- /dev/null
+++ b/tests/ps/test-array.ps
@@ -0,0 +1,11 @@
+initunittest
+
+true /array [[/integertype]] typecheck
+false /array [[/booleantype /realtype /arraytype /stringtype /dicttype /nulltype /operatortype /marktype /filetype /savetype /proctype]] typecheck
+
+[] /stackunderflow true initunittestdict {array} unittest
+[[null]] null true initunittestdict {1 array} unittest
+[65536] /rangecheck true initunittestdict {65536 array} unittest
+[-1] /rangecheck true initunittestdict {-1 array} unittest
+
+unittestresult
diff --git a/tests/ps/test-astore.ps b/tests/ps/test-astore.ps
new file mode 100644
index 0000000..0f1bb9f
--- /dev/null
+++ b/tests/ps/test-astore.ps
@@ -0,0 +1,13 @@
+initunittest
+
+true /astore [.unittestdict /anytypes get [/arraytype /proctype]] typecheck
+false /astore [.unittestdict /anytypes get [/booleantype /integertype /realtype /nametype /stringtype /dicttype /nulltype /operatortype /marktype /filetype /savetype]] typecheck
+
+[] /stackunderflow true initunittestdict {astore} unittest
+[1 2 [null null null]] /stackunderflow true initunittestdict {1 2 3 array astore} unittest
+[1 [null]] /invalidaccess true initunittestdict {1 1 array noaccess astore} unittest
+[1 [null]] /invalidaccess true initunittestdict {1 1 array readonly astore} unittest
+[1 [2]] null true initunittestdict {1 2 1 array astore} unittest
+[[(a) (bcd) (ef)]] null true initunittestdict {(a) (bcd) (ef) 3 array astore} unittest
+
+unittestresult
diff --git a/tests/ps/test-atan.ps b/tests/ps/test-atan.ps
new file mode 100644
index 0000000..122d7be
--- /dev/null
+++ b/tests/ps/test-atan.ps
@@ -0,0 +1,16 @@
+initunittest
+
+true /atan [[/integertype /realtype] dup] typecheck
+false /atan [[/booleantype /nametype /arraytype /stringtype /dicttype /nulltype /operatortype /marktype /filetype /savetype /proctype] dup] typecheck
+false /atan [[/integertype /realtype] [/booleantype /nametype /arraytype /stringtype /dicttype /nulltype /operatortype /marktype /filetype /savetype /proctype]] typecheck
+false /atan [[/booleantype /nametype /arraytype /stringtype /dicttype /nulltype /operatortype /marktype /filetype /savetype /proctype] [/integertype /realtype]] typecheck
+
+[] /stackunderflow true initunittestdict {atan} unittest
+[1] /stackunderflow true initunittestdict {1 atan} unittest
+[0 0] /undefinedresult true initunittestdict {0 0 atan} unittest
+[0.0] null true initunittestdict {0 1 atan} unittest
+[90.0] null true initunittestdict {1 0 atan} unittest
+[270.0] null true initunittestdict {-100 0 atan} unittest
+[45.0] null true initunittestdict {4 4 atan} unittest
+
+unittestresult
diff --git a/tests/ps/test-begin.ps b/tests/ps/test-begin.ps
new file mode 100644
index 0000000..5763b0f
--- /dev/null
+++ b/tests/ps/test-begin.ps
@@ -0,0 +1,9 @@
+initunittest
+
+true /begin [[/dicttype]] typecheck
+false /begin [[/booleantype /integertype /realtype /nametype /arraytype /stringtype /nulltype /operatortype /marktype /filetype /savetype /proctype]] typecheck
+
+[] /stackunderflow true initunittestdict {begin} unittest
+% FIXME
+
+unittestresult
diff --git a/tests/ps/test-bind.ps b/tests/ps/test-bind.ps
new file mode 100644
index 0000000..1254013
--- /dev/null
+++ b/tests/ps/test-bind.ps
@@ -0,0 +1,9 @@
+initunittest
+
+true /bind [[/arraytype /proctype]] typecheck
+false /bind [[/booleantype /integertype /realtype /nametype /stringtype /dicttype /nulltype /operatortype /marktype /filetype /savetype]] typecheck
+
+[] /stackunderflow true initunittestdict {bind} unittest
+% FIXME
+
+unittestresult
diff --git a/tests/ps/test-bitshift.ps b/tests/ps/test-bitshift.ps
new file mode 100644
index 0000000..0c2fdc3
--- /dev/null
+++ b/tests/ps/test-bitshift.ps
@@ -0,0 +1,13 @@
+initunittest
+
+true /bitshift [[/integertype] dup] typecheck
+false /bitshift [[/booleantype /realtype /nametype /arraytype /stringtype /dicttype /nulltype /operatortype /marktype /filetype /savetype /proctype] dup] typecheck
+false /bitshift [[/integertype] [/booleantype /realtype /nametype /arraytype /stringtype /dicttype /nulltype /operatortype /marktype /filetype /savetype /proctype]] typecheck
+false /bitshift [[/booleantype /realtype /nametype /arraytype /stringtype /dicttype /nulltype /operatortype /marktype /filetype /savetype /proctype] [/integertype]] typecheck
+
+[] /stackunderflow true initunittestdict {bitshift} unittest
+[1] /stackunderflow true initunittestdict {1 bitshift} unittest
+[56] null true initunittestdict {7 3 bitshift} unittest
+[17] null true initunittestdict {142 -3 bitshift} unittest
+
+unittestresult