tests.scm (1034B)
1 (import (srfi srfi-64) 2 3 (ice-9 rdelim) 4 (ice-9 textual-ports) 5 6 (pstk)) 7 8 (define-syntax-rule (test-read-expected input-string expected-string after-expected-string) 9 (let* ((port (open-input-string input-string)) 10 (expected? (read-expected expected-string port))) 11 12 (test-equal after-expected-string 13 (get-string-all port)))) 14 15 (test-begin "read-expected") 16 17 (test-read-expected "" "abc" "") 18 (test-read-expected "a" "abc" "a") 19 (test-read-expected "b" "abc" "b") 20 21 (test-read-expected "ab" "abc" "ab") 22 (test-read-expected "ba" "abc" "ba") 23 (test-read-expected "ac" "abc" "ac") 24 25 (test-read-expected "abc" "abc" "") 26 (test-read-expected "bbc" "abc" "bbc") 27 (test-read-expected "abd" "abc" "abd") 28 (test-read-expected "bbc" "abc" "bbc") 29 (test-read-expected "adc" "abc" "adc") 30 (test-read-expected "abcd" "abc" "d") 31 (test-read-expected "bbcd" "abc" "bbcd") 32 (test-read-expected "abdd" "abc" "abdd") 33 (test-read-expected "bbcd" "abc" "bbcd") 34 (test-read-expected "adcd" "abc" "adcd") 35 36 (test-end "read-expected")