From 5f7b1e3790f3941a12326aec10f90ca55fe0e1c3 Mon Sep 17 00:00:00 2001 From: Taylan Kammer Date: Mon, 10 May 2021 15:26:10 +0200 Subject: [PATCH 2/2] Augment SRFI-64 test-suite. * test-suite/tests/srfi-64-test.scm ("1.3. test-approximate"): New section. ("2.1.4. FAIL with a test name and error type"): ("2.1.5. PASS with an error type but no name"): ("2.1.6. FAIL with an error type but no name"): New tests. --- test-suite/tests/srfi-64-test.scm | 37 +++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/test-suite/tests/srfi-64-test.scm b/test-suite/tests/srfi-64-test.scm index ca0b58943..b7f6d2934 100644 --- a/test-suite/tests/srfi-64-test.scm +++ b/test-suite/tests/srfi-64-test.scm @@ -167,6 +167,19 @@ (test-end);1.2 +(test-begin "1.3. test-approximate") + +(test-equal + "1.3.1. Simple numerical approximation" + '(("a" "c") ("b") () () () (2 1 0 0 0)) + (triv-runner + (lambda () + (test-approximate "a" (mean 3 5) 4 0.001) + (test-approximate "b" (mean 3 5) 4.5 0.001) + (test-approximate "c" (mean 3 5) 4.0 0.001)))) + +(test-end);1.3 + (test-end "1. Simple test-cases") ;;; @@ -202,6 +215,30 @@ ;; PASS (test-error "a" #t (vector-ref '#(1 2) 9))))) +(test-equal + "2.1.4. FAIL with a test name and error type" + '(() ("a") () () () (0 1 0 0 0)) + (triv-runner + (lambda () + ;; FAIL + (test-error "a" #t (vector-ref '#(1 2) 0))))) + +(test-equal + "2.1.5. PASS with an error type but no name" + '(("") () () () () (1 0 0 0 0)) + (triv-runner + (lambda () + ;; PASS + (test-error #t (vector-ref '#(1 2) 9))))) + +(test-equal + "2.1.6. FAIL with an error type but no name" + '(() ("") () () () (0 1 0 0 0)) + (triv-runner + (lambda () + ;; FAIL + (test-error #t (vector-ref '#(1 2) 0))))) + (test-end "2.1. test-error") (test-end "2. Tests for catching errors") -- 2.30.2