summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/bnftest18
-rw-r--r--tests/bnftest.224
-rw-r--r--tests/test.utf161
-rw-r--r--tests/test.utf16be1
-rw-r--r--tests/test.utf16le1
5 files changed, 45 insertions, 0 deletions
diff --git a/tests/bnftest b/tests/bnftest
new file mode 100644
index 0000000..7e61b1a
--- /dev/null
+++ b/tests/bnftest
@@ -0,0 +1,18 @@
1tokens = tokPlus tokMinus tokMult tokDivide tokOpenParen tokCloseParen
2 tokEquals tokNumber;
3
4input: input line
5 |
6 ;
7
8line: expr tokEquals {print}
9 ;
10
11expr: expr tokPlus expr {add}
12 | expr tokMinus expr {subtract}
13 | expr tokMult expr {multiply}
14 | expr tokDivide expr {divide}
15 | tokOpenParen expr tokCloseParen
16 | [tokNumber]
17 ;
18
diff --git a/tests/bnftest.2 b/tests/bnftest.2
new file mode 100644
index 0000000..229943b
--- /dev/null
+++ b/tests/bnftest.2
@@ -0,0 +1,24 @@
1tokens = tokPlus tokMinus tokMult tokDivide tokOpenParen tokCloseParen
2 tokEquals tokNumber;
3
4input: line input#
5 |
6 ;
7
8input#: line input#
9 |
10 ;
11
12line: expr tokEquals {print}
13 ;
14
15expr: tokOpenParen expr tokCloseParen expr#
16 | [tokNumber] expr#
17 ;
18
19expr#: tokPlus expr {add} expr#
20 | tokMinus expr {subtract} expr#
21 | tokMult expr {multiply} expr#
22 | tokDivide expr {divide} expr#
23 |
24 ;
diff --git a/tests/test.utf16 b/tests/test.utf16
new file mode 100644
index 0000000..86a63c3
--- /dev/null
+++ b/tests/test.utf16
@@ -0,0 +1 @@
¥Ëæ)˜Ø=Þ<Ûÿßý$H \ No newline at end of file
diff --git a/tests/test.utf16be b/tests/test.utf16be
new file mode 100644
index 0000000..136ad1a
--- /dev/null
+++ b/tests/test.utf16be
@@ -0,0 +1 @@
þÿ¥Ëæ)˜Ø=Þ<Ûÿßý$H \ No newline at end of file
diff --git a/tests/test.utf16le b/tests/test.utf16le
new file mode 100644
index 0000000..9f610d6
--- /dev/null
+++ b/tests/test.utf16le
@@ -0,0 +1 @@
ÿþ¥Ëæ˜)=Ø<ÞÿÛýßH$ \ No newline at end of file