(import (scheme base) (only (csc testing) assert assert-equal test) (csc strings)) (test prefix?-good (assert-equal #t (prefix? "asdf" "asdfjkl;"))) (test prefix?-bad (assert-equal #f (prefix? "asdf" "asdbjkl;"))) (test prefix?-too-long (assert-equal #f (prefix? "asdf" "as"))) (test str-quote-simple (assert-equal "\"hello\"" (str-quote "hello"))) (test str-quote-escape (assert-equal "\"this string \\\" has a quote\"" (str-quote "this string \" has a quote"))) (test find-ok (assert-equal 8 (find "abc" "dabsadfdabcdfdfd"))) (test find-one-letter (assert-equal 8 (find "a" "sdfdfdfsasdfe"))) (test test-str-find-notfound (let* ((match "a") (str "def") (got-exception '())) (guard (e ((not-found-error? e) (set! got-exception e))) (find match str)) (assert (not-found-error? got-exception))))