aboutsummaryrefslogtreecommitdiffstats
path: root/tests/string.scm
diff options
context:
space:
mode:
authorGravatar Peter McGoron 2024-12-28 23:00:53 -0500
committerGravatar Peter McGoron 2024-12-28 23:00:53 -0500
commita7d440f5b5e1d048fb51174c2d719bb460ff936d (patch)
treeca3cab0d63e3cf4dffbbc6e984b727ae111bed4e /tests/string.scm
parentrefactor string exceptions (diff)
refactor tests to check type of exception
Diffstat (limited to 'tests/string.scm')
-rw-r--r--tests/string.scm7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/string.scm b/tests/string.scm
index 7625acc..e8d2671 100644
--- a/tests/string.scm
+++ b/tests/string.scm
@@ -26,7 +26,8 @@
(iterator-advance itr 0)))
(test "iterator->index" 0 (iterator->index itr))
(test-assert "iterator=?" (iterator=? itr (string-iterator-end str)))
- (test-error "iterator-ref" (iterator-ref itr))))
+ (test-assert "iterator-ref" (with-exception-check ref-at-end
+ (iterator-ref itr)))))
(let* ((str "a")
(itr (string-iterator-start str))
@@ -50,5 +51,7 @@
(iterator=? itr (iterator-advance next-itr -1)))
(test "iterator->index next-itr" 1
(iterator->index next-itr))
- (test-error "iterator-ref next-itr" (iterator-ref next-itr)))))
+ (test-assert "iterator-ref next-itr"
+ (with-exception-check ref-at-end
+ (iterator-ref next-itr))))))