Merge in the test suite.
Why not? (I have a slow tide, expand into pieces, contract into units, and back again. This is part of a contract and unify phase.)
This commit is contained in:
parent
00f4bfcacd
commit
69689f8cc6
|
|
@ -0,0 +1,44 @@
|
|||
# The general command line is, e.g.:
|
||||
#
|
||||
# gmake -j
|
||||
#
|
||||
# To make all the tests, e.g.:
|
||||
#
|
||||
# gmake -j --always-make
|
||||
#
|
||||
# (The the g- prefix indicates that this is GNU make or compatible,
|
||||
# the ``-j`` switch tells make to use multiple jobs to take advantage of
|
||||
# multi-core systems.)
|
||||
#
|
||||
# For the explanation of how this test system works see:
|
||||
# https://chrismorgan.info/blog/make-and-git-diff-test-harness/
|
||||
|
||||
# Set JOY to point to the joy interpreter to test.
|
||||
#JOY=joy
|
||||
|
||||
TESTS != ls *.joy
|
||||
STDOUTS = $(TESTS:.joy=.stdout)
|
||||
|
||||
GIT_OPTS = --exit-code
|
||||
GIT_OPTS += --src-prefix=expected/ --dst-prefix=actual/
|
||||
GIT_OPTS += --name-only
|
||||
|
||||
# N.B. I'm using FreeBSD with GNU coreutils, so gtouch rather than touch
|
||||
# (for that --date opt.) It's not ideal to hard-code the g- prefix here,
|
||||
# I know, but it was faster than rewriting the command to use FreeBSD's
|
||||
# touch as I already had coreutils installed for other reasons. If you
|
||||
# are using GNU coreutils natively on your system then you can remove the
|
||||
# g- prefix here.
|
||||
|
||||
TOUCH = touch --date=@0
|
||||
|
||||
|
||||
.PHONY: test
|
||||
|
||||
test: $(STDOUTS)
|
||||
|
||||
%.stdout: %.joy
|
||||
@$(JOY) < $< > $@ 2> $*.stderr || ($(TOUCH) $@; false)
|
||||
@git diff $(GIT_OPTS) $@ $*.stderr || ($(TOUCH) $@; false)
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
# Simple Test Set for Joy Programming Language
|
||||
|
||||
Each test consists of a snippet of Joy code along with the expected
|
||||
output (stdout and stderr) for a (conforming) Joy implementation. They
|
||||
are run with make.
|
||||
|
||||
For the explanation of how this test system works see:
|
||||
https://chrismorgan.info/blog/make-and-git-diff-test-harness/
|
||||
|
||||
Set the JOY environment variable to point to the joy interpreter to test,
|
||||
e.g.:
|
||||
|
||||
export JOY="python -m joy -q"
|
||||
|
||||
-or-
|
||||
|
||||
setenv JOY "python -m joy -q"
|
||||
|
||||
or whatever for your shell. Then run make.
|
||||
|
||||
The general command line is, e.g.:
|
||||
|
||||
gmake -j
|
||||
|
||||
To make all the tests, e.g.:
|
||||
|
||||
gmake -j --always-make
|
||||
|
||||
The the ``g-`` prefix indicates that this is GNU make (or compatible), and
|
||||
the ``-j`` switch tells make to use multiple jobs to take advantage of
|
||||
multi-core systems.
|
||||
|
|
@ -0,0 +1 @@
|
|||
1 2 +
|
||||
|
|
@ -0,0 +1 @@
|
|||
3
|
||||
|
|
@ -0,0 +1 @@
|
|||
1 -2 +
|
||||
|
|
@ -0,0 +1 @@
|
|||
-1
|
||||
|
|
@ -0,0 +1 @@
|
|||
2 +
|
||||
|
|
@ -0,0 +1 @@
|
|||
Not enough values on stack.
|
||||
|
|
@ -0,0 +1 @@
|
|||
|
||||
|
|
@ -0,0 +1 @@
|
|||
+
|
||||
|
|
@ -0,0 +1 @@
|
|||
Not enough values on stack.
|
||||
|
|
@ -0,0 +1 @@
|
|||
|
||||
|
|
@ -0,0 +1 @@
|
|||
1 true +
|
||||
|
|
@ -0,0 +1 @@
|
|||
Not an integer.
|
||||
|
|
@ -0,0 +1 @@
|
|||
|
||||
|
|
@ -0,0 +1 @@
|
|||
1 [] +
|
||||
|
|
@ -0,0 +1 @@
|
|||
Not an integer.
|
||||
|
|
@ -0,0 +1 @@
|
|||
|
||||
|
|
@ -0,0 +1 @@
|
|||
true bool
|
||||
|
|
@ -0,0 +1 @@
|
|||
true
|
||||
|
|
@ -0,0 +1 @@
|
|||
false bool
|
||||
|
|
@ -0,0 +1 @@
|
|||
false
|
||||
|
|
@ -0,0 +1 @@
|
|||
-1 bool 0 bool 1 bool
|
||||
|
|
@ -0,0 +1 @@
|
|||
true false true
|
||||
|
|
@ -0,0 +1 @@
|
|||
[] bool [[]] bool
|
||||
|
|
@ -0,0 +1 @@
|
|||
false true
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
true false _\/_
|
||||
false true _\/_
|
||||
false false _\/_
|
||||
true true _\/_
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
true
|
||||
true true
|
||||
true true false
|
||||
true true false false
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
23 false _\/_
|
||||
false [] _\/_
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
Not a Boolean value.
|
||||
Not a Boolean value.
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
|
||||
|
||||
|
|
@ -0,0 +1 @@
|
|||
true [1] [2] branch
|
||||
|
|
@ -0,0 +1 @@
|
|||
2
|
||||
|
|
@ -0,0 +1 @@
|
|||
false [1] [2] branch
|
||||
|
|
@ -0,0 +1 @@
|
|||
1
|
||||
|
|
@ -0,0 +1 @@
|
|||
1 2 3 clear 4 5 6
|
||||
|
|
@ -0,0 +1 @@
|
|||
4 5 6
|
||||
|
|
@ -0,0 +1 @@
|
|||
1 1 = 1 2 = 2 1 = -1 1 =
|
||||
|
|
@ -0,0 +1 @@
|
|||
true false false false
|
||||
|
|
@ -0,0 +1 @@
|
|||
1 1 >= 1 2 >= 2 1 >= -1 1 >=
|
||||
|
|
@ -0,0 +1 @@
|
|||
true false true false
|
||||
|
|
@ -0,0 +1 @@
|
|||
1 1 > 1 2 > 2 1 > -1 1 >
|
||||
|
|
@ -0,0 +1 @@
|
|||
false false true false
|
||||
|
|
@ -0,0 +1 @@
|
|||
1 1 <= 1 2 <= 2 1 <= -1 1 <=
|
||||
|
|
@ -0,0 +1 @@
|
|||
true true false true
|
||||
|
|
@ -0,0 +1 @@
|
|||
1 1 < 1 2 < 2 1 < -1 1 <
|
||||
|
|
@ -0,0 +1 @@
|
|||
false true false true
|
||||
|
|
@ -0,0 +1 @@
|
|||
1 1 <> 1 2 <> 2 1 <> -1 1 <>
|
||||
|
|
@ -0,0 +1 @@
|
|||
false true true true
|
||||
|
|
@ -0,0 +1 @@
|
|||
[1 2 3] [4 5 6] concat
|
||||
|
|
@ -0,0 +1 @@
|
|||
[1 2 3 4 5 6]
|
||||
|
|
@ -0,0 +1 @@
|
|||
23 [18] cons
|
||||
|
|
@ -0,0 +1 @@
|
|||
[23 18]
|
||||
|
|
@ -0,0 +1 @@
|
|||
1 2 cons
|
||||
|
|
@ -0,0 +1 @@
|
|||
Not a list.
|
||||
|
|
@ -0,0 +1 @@
|
|||
|
||||
|
|
@ -0,0 +1 @@
|
|||
[] cons
|
||||
|
|
@ -0,0 +1 @@
|
|||
Not enough values on stack.
|
||||
|
|
@ -0,0 +1 @@
|
|||
|
||||
|
|
@ -0,0 +1 @@
|
|||
23 cons
|
||||
|
|
@ -0,0 +1 @@
|
|||
Not a list.
|
||||
|
|
@ -0,0 +1 @@
|
|||
|
||||
|
|
@ -0,0 +1 @@
|
|||
1 3 [2] dip
|
||||
|
|
@ -0,0 +1 @@
|
|||
1 2 3
|
||||
|
|
@ -0,0 +1 @@
|
|||
1 2 [dup] dip
|
||||
|
|
@ -0,0 +1 @@
|
|||
1 1 2
|
||||
|
|
@ -0,0 +1 @@
|
|||
1 2 [] dip
|
||||
|
|
@ -0,0 +1 @@
|
|||
1 2
|
||||
|
|
@ -0,0 +1 @@
|
|||
[23] dip
|
||||
|
|
@ -0,0 +1 @@
|
|||
Not enough values on stack.
|
||||
|
|
@ -0,0 +1 @@
|
|||
|
||||
|
|
@ -0,0 +1 @@
|
|||
dip
|
||||
|
|
@ -0,0 +1 @@
|
|||
Not enough values on stack.
|
||||
|
|
@ -0,0 +1 @@
|
|||
|
||||
|
|
@ -0,0 +1 @@
|
|||
10 2 /
|
||||
|
|
@ -0,0 +1 @@
|
|||
5
|
||||
|
|
@ -0,0 +1 @@
|
|||
10 -2 /
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue