From 380f73683f078b0bc85531b5efdf27004eda6bb4 Mon Sep 17 00:00:00 2001 From: Jon Michael Aanes Date: Fri, 28 Dec 2018 19:56:28 +0100 Subject: [PATCH] Converted some more tests to use the new test system. --- example.scm | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/example.scm b/example.scm index 1384013..0c14ae5 100644 --- a/example.scm +++ b/example.scm @@ -239,23 +239,15 @@ (header "R5RS: Test if-expressions") -(display "If-then exp!\n\tExpect: 6\n\tGotten: ") -(display (* 3 (if #t 2 0))) -(newline) +(test "If expressions exp!" + `( + (6 . ,(* 3 (if #t 2 0))) + (0 . ,(* 3 (if #f 2 0))) + ("Hello World" . ,(if #t "Hello World")) + ("???" . ,(if #f "Hello World")) + )) -(display "If-else exp!\n\tExpect: 0\n\tGotten: ") -(display (* 3 (if #f 2 0))) -(newline) - -(display "If-one-branch exp!\n\tExpect: Hello World\n\tGotten: ") -(if #t (display "Hello World\n")) - -(display "If-one-branch exp!\n\tExpect: \n\tGotten: ") -(if #f (display "Hello World\n")) - -(newline) -(display "* R5RS: Testing Eval system *") -(newline) +(header "R5RS: Testing Eval system") (display "Eval expression. Expect 6: ") (display (eval '(* 2 (cdr '(2 . 3))) (scheme-report-environment 5)))