Added numbers to tests
This commit is contained in:
parent
e3316d6cbe
commit
79b9831f27
|
@ -8,30 +8,29 @@
|
|||
|
||||
?(?-) (Formatter)
|
||||
|
||||
?((aaa (bbb)) ok) aaa(bbb) = ok (formatter 1) test
|
||||
?(((bbb) aaa) ok) (bbb)aaa = ok (formatter 2) test
|
||||
?(((?a ?b ?c)) ((?a ?b ?c))) (a b c ) = (a b c) (formatter 3) test
|
||||
?(((?a ?b ?c)) ((?a ?b ?c))) ( a b c) = (a b c) (formatter 4) test
|
||||
?(((?a ?b ?c)) ((?a ?b ?c))) ( a b c ) = (a b c) (formatter 5) test
|
||||
?(((?a ?b ?c (?d ?e ?f))) ((?a ?b ?c (?d ?e ?f)))) (a b c ( a b c ) ) = (a b c (a b c)) (formatter 6) test
|
||||
?((aaa (bbb)) ok) aaa(bbb) = ok (formatter 1/6) test
|
||||
?(((bbb) aaa) ok) (bbb)aaa = ok (formatter 2/6) test
|
||||
?(((?a ?b ?c)) ((?a ?b ?c))) (a b c ) = (a b c) (formatter 3/6) test
|
||||
?(((?a ?b ?c)) ((?a ?b ?c))) ( a b c) = (a b c) (formatter 4/6) test
|
||||
?(((?a ?b ?c)) ((?a ?b ?c))) ( a b c ) = (a b c) (formatter 5/6) test
|
||||
?(((?a ?b ?c (?d ?e ?f))) ((?a ?b ?c (?d ?e ?f)))) (a b c ( a b c ) ) = (a b c (a b c)) (formatter 6/6) test
|
||||
|
||||
?(?-) (Empty replacements)
|
||||
|
||||
(ab cd () ghost) = (ab cd ()) (empty 1) test
|
||||
(ab cd ghost ()) = (ab cd ()) (empty 2) test
|
||||
(ab ghost cd ()) = (ab cd ()) (empty 3) test
|
||||
(ghost ab cd ()) = (ab cd ()) (empty 4) test
|
||||
(ghost) = () (empty 5) test
|
||||
|
||||
(q ?((?x ?y ?z) (?x ?y)) a b c) = (q a b) (empty 6) test
|
||||
(q ?((?x ?y ?z) (?x ?z)) a b c) = (q a c) (empty 7) test
|
||||
(q ?((?x ?y ?z) (?y ?z)) a b c) = (q b c) (empty 8) test
|
||||
(ab cd () ghost) = (ab cd ()) (empty 1/10) test
|
||||
(ab cd ghost ()) = (ab cd ()) (empty 2/10) test
|
||||
(ab ghost cd ()) = (ab cd ()) (empty 3/10) test
|
||||
(ghost ab cd ()) = (ab cd ()) (empty 4/10) test
|
||||
(ghost) = () (empty 5/10) test
|
||||
(q ?((?x ?y ?z) (?x ?y)) a b c) = (q a b) (empty 6/10) test
|
||||
(q ?((?x ?y ?z) (?x ?z)) a b c) = (q a c) (empty 7/10) test
|
||||
(q ?((?x ?y ?z) (?y ?z)) a b c) = (q b c) (empty 8/10) test
|
||||
|
||||
<> (prefix/pop ?x) ()
|
||||
<> (?x suffix/pop) ()
|
||||
|
||||
(ab prefix/pop cd ef) = (ab ef) (empty 9) test
|
||||
(ab cd suffix/pop ef) = (ab ef) (empty 10) test
|
||||
(ab prefix/pop cd ef) = (ab ef) (empty 9/10) test
|
||||
(ab cd suffix/pop ef) = (ab ef) (empty 10/10) test
|
||||
|
||||
?(?-) (Basic register setups)
|
||||
|
||||
|
@ -41,50 +40,42 @@
|
|||
<> (rotate (?x (?y (?z)))) (?y (?z (?x)))
|
||||
<> (unused ?x) ?y
|
||||
|
||||
(dup (abc)) = (abc abc) (basic 1) test
|
||||
(swap (abc def)) = (def abc) (basic 2) test
|
||||
(compare (abc abc abc)) = (#t) (basic 3) test
|
||||
(rotate (abc (def (ghi)))) = (def (ghi (abc))) (basic 4) test
|
||||
(unused hey) = (?y) (basic 5) test
|
||||
(dup (abc)) = (abc abc) (basic 1/5) test
|
||||
(swap (abc def)) = (def abc) (basic 2/5) test
|
||||
(compare (abc abc abc)) = (#t) (basic 3/5) test
|
||||
(rotate (abc (def (ghi)))) = (def (ghi (abc))) (basic 4/5) test
|
||||
(unused hey) = (?y) (basic 5/5) test
|
||||
|
||||
?(?-) (Substring registers)
|
||||
|
||||
<> (connect ?x ?y ?z) (?x-?y?z)
|
||||
<> (prefix-?x) (?x-suffix)
|
||||
|
||||
connect foo bar baz = foo-barbaz (substring 1) test
|
||||
prefix-anything = anything-suffix (substring 2) test
|
||||
?(foo QQQ) foobar = foobar (substring 3) test
|
||||
connect foo bar baz = foo-barbaz (substring 1/3) test
|
||||
prefix-anything = anything-suffix (substring 2/3) test
|
||||
?(foo QQQ) foobar = foobar (substring 3/3) test
|
||||
|
||||
?(?-) (Lambdas)
|
||||
|
||||
(?(?x (?x ?x)) abc) = (abc abc) (lambda 1) test
|
||||
abc ?(?x) def = abc (lambda 2) test
|
||||
(?(?x (?x ?x)) abc) = (abc abc) (lambda 1/2) test
|
||||
abc ?(?x) def = abc (lambda 2/2) test
|
||||
|
||||
?(?-) (op: explode)
|
||||
|
||||
(?(?* ?*) cow) = (c (o (w ()))) (explode word) test
|
||||
(?(?* ?*) (12 34 45)) = (12 (34 (45 ()))) (explode tuple) test
|
||||
(?(?* ?*) ()) = () (explode empty) test
|
||||
(?(?* ?*) cow) = (c (o (w ()))) (explode word 1/3) test
|
||||
(?(?* ?*) (12 34 45)) = (12 (34 (45 ()))) (explode tuple 2/3) test
|
||||
(?(?* ?*) ()) = () (explode empty 3/3) test
|
||||
|
||||
?(?-) (op: join)
|
||||
|
||||
?(?^ ?^) (b (a (t ()))) = bat (join 1) test
|
||||
?(?^ ?^) (12 (34 (56 ()))) = 123456 (join 2) test
|
||||
(?(?^ ?^) ()) = () (join empty) test
|
||||
?(?^ ?^) (b (a (t ()))) = bat (join 1/3) test
|
||||
?(?^ ?^) (12 (34 (56 ()))) = 123456 (join 2/3) test
|
||||
(?(?^ ?^) ()) = () (join 3/3) test
|
||||
|
||||
?(?-) (op: unwrap)
|
||||
|
||||
?(?. ?.) (abcd) = abcd (unwrap 1) test
|
||||
(?(?. ?.) ()) = () (unwrap empty) test
|
||||
|
||||
?(?-) (List reversal)
|
||||
|
||||
<> (reverse List () ?^) (?^)
|
||||
<> (reverse (?*)) (reverse List (?*) ())
|
||||
<> (reverse List (?x ?y) ?z) (reverse List ?y (?x ?z))
|
||||
|
||||
reverse (modal) = ladom (reverse 1) test
|
||||
?(?. ?.) (abcd) = abcd (unwrap 1/2) test
|
||||
(?(?. ?.) ()) = () (unwrap 2/2) test
|
||||
|
||||
?(?-) (Incomplete definitions)
|
||||
|
||||
|
@ -94,17 +85,17 @@ reverse (modal) = ladom (reverse 1) test
|
|||
<> (incomplete-reg ?x)
|
||||
<> (waste-rule) *
|
||||
|
||||
(incomplete-basic) = () (incomplete 1) test
|
||||
(incomplete-reg abcdef) = () (incomplete 2) test
|
||||
(?(?x) incomplete-lambda) = () (incomplete 3) test
|
||||
(?() abc) = (abc) (incomplete 4) test
|
||||
(incomplete-basic) = () (incomplete 1/4) test
|
||||
(incomplete-reg abcdef) = () (incomplete 2/4) test
|
||||
(?(?x) incomplete-lambda) = () (incomplete 3/4) test
|
||||
(?() abc) = (abc) (incomplete 4/4) test
|
||||
|
||||
?(?-) (Inline rules)
|
||||
|
||||
<> ((?x -> ?y)) (<> ?x ?y)
|
||||
(nap -> (tap =))
|
||||
|
||||
nap tap (inline 1) test
|
||||
nap tap (inline 1/1) test
|
||||
|
||||
?(?-) (Undefinition)
|
||||
|
||||
|
@ -113,27 +104,35 @@ nap tap (inline 1) test
|
|||
<> (undefine-me) (ghi)
|
||||
>< (undefine-me)
|
||||
|
||||
(undefine-me) = (def) (undefinition 1) test
|
||||
(undefine-me) = (def) (undefinition 1/3) test
|
||||
|
||||
>< (undefine-me)
|
||||
|
||||
(undefine-me) = (ghi) (undefinition 2) test
|
||||
(undefine-me) = (ghi) (undefinition 2/3) test
|
||||
|
||||
>< (undefine-unknown)
|
||||
|
||||
?(* (>< (undefine-me))) *
|
||||
|
||||
(undefine-me) = (undefine-me) (undefinition 3) test
|
||||
(undefine-me) = (undefine-me) (undefinition 3/3) test
|
||||
|
||||
?(?-) (Arithmetic)
|
||||
|
||||
?((?: ?0 ?1 ?2) ?:) + 1 2 3 = 6 (Arithmetic 1) test
|
||||
?((?0 ?: ?1) ?:) 16 - 8 = 8 (Arithmetic 2) test
|
||||
?((?0 ?1 ?:) ?:) 12 10 * = 120 (Arithmetic 3) test
|
||||
?((?: ?0 ?1 ?2) ?:) + 1 2 3 = 6 (Arithmetic 1/4) test
|
||||
?((?0 ?: ?1) ?:) 16 - 8 = 8 (Arithmetic 2/4) test
|
||||
?((?0 ?1 ?:) ?:) 12 10 * = 120 (Arithmetic 3/4) test
|
||||
|
||||
<> (?0 ?1 `?:) (?:)
|
||||
|
||||
(12 45 `+ -2 `+) = (55) (Arithmetic 4) test
|
||||
(12 45 `+ -2 `+) = (55) (Arithmetic 4/4) test
|
||||
|
||||
?(?-) (List reversal)
|
||||
|
||||
<> (reverse List () ?^) (?^)
|
||||
<> (reverse (?*)) (reverse List (?*) ())
|
||||
<> (reverse List (?x ?y) ?z) (reverse List ?y (?x ?z))
|
||||
|
||||
reverse (modal) = ladom (reverse 1) test
|
||||
|
||||
?(?-) (Late Test Primitives)
|
||||
|
||||
|
|
3
makefile
3
makefile
|
@ -15,8 +15,7 @@ test: all bin/modal-debug bin/modal
|
|||
@ bin/modal -v
|
||||
@ bin/modal-debug -q examples/fizzbuzz.modal
|
||||
@ bin/modal-debug -q examples/sierpinski.modal
|
||||
@ bin/modal-debug -q examples/tests.modal
|
||||
@ bin/modal-debug -q -a examples/file.modal
|
||||
@ bin/modal-debug -q -a examples/tests.modal
|
||||
install: bin/modal
|
||||
cp bin/modal ~/bin/
|
||||
uninstall:
|
||||
|
|
Loading…
Reference in New Issue