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)))