From 08173b4eb95c548c7aee097a08c29827d0de9fe0 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Mon, 15 Apr 2024 17:18:18 -0700 Subject: [PATCH] Starting tests --- examples/tests.modal | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/examples/tests.modal b/examples/tests.modal index a77550b..fb81930 100644 --- a/examples/tests.modal +++ b/examples/tests.modal @@ -1,18 +1,20 @@ ?(?-) (This example tests various aspects of the implementation.) -<> (explode ?*) (str (?*)) -<> (reverse (str (?h ?t))) (reverse/l ?t (?h)) -<> (reverse (str (?h))) (?h) -<> (reverse/l (?h ?t) ?l) (reverse/l ?t (?h ?l)) -<> (reverse/l (?h) ?l) (str (?h ?l)) -<> (implode str ?*) (?*) -<> (empty-register) (?x) -<> (explode ?*) (str (?*)) -<> (eq ?x ?x) (#t) -<> (eq ?x ?y) (#f) -<> (?x dup) (?x ?x) -<> (?x ?y swap) (?y ?x) -<> (?x pop) () -<> (print ?:) (?:) +<> (?: print) (?:) +<> (?x = ?x test) (#ok) +<> (?x = ?y test) (#fail) + +?(?-) (Basic register setups) + +<> (dup (?x)) ((?x ?x) =) +<> (swap (?x ?y)) ((?y ?x) =) +<> (compare (?x ?x ?x)) ((#t) =) + +dup (abc) (abc abc) test +swap (abc def) (def abc) test +compare (abc abc abc) (#t) test + +?(?-) (Lambdas) + +?((?x) ((?x ?x) =)) abc (abc abc) test -(implode reverse (explode hello)) (explode hello) empty-register (eq abc abc) (eq abc def) (1 2 3) (4 5 6) swap pop dup (hey 1234 pop) (print Done.)