From d29d7733fc0c8bffeeda8f71d8c30c7fc5a354d9 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Sun, 11 Dec 2011 14:20:42 +0900 Subject: [PATCH] adding basic string tests --- tests/r5rs-tests.scm | 48 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/tests/r5rs-tests.scm b/tests/r5rs-tests.scm index 048c36d7..9673c081 100644 --- a/tests/r5rs-tests.scm +++ b/tests/r5rs-tests.scm @@ -177,6 +177,10 @@ (test #t (equal? "abc" "abc")) +(test #f (equal? "abc" "abcd")) + +(test #f (equal? "a" "b")) + (test #t (equal? 2 2)) ;;(test #f (eqv? 2 2.0)) @@ -358,6 +362,50 @@ (test "Malvina" (symbol->string (string->symbol "Malvina"))) +(test #t (string? "a")) + +(test #f (string? 'a)) + +(test 0 (string-length "")) + +(test 3 (string-length "abc")) + +(test #\a (string-ref "abc" 0)) + +(test #\c (string-ref "abc" 2)) + +(test "axc" (let ((s (string #\a #\b #\c))) (string-set! s 1 #\x) s)) + +(test #t (string=? "a" (string #\a))) + +(test #f (string=? "a" (string #\b))) + +(test #t (string