mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
Adding additional tests for char names and string escapes.
This commit is contained in:
parent
4ffcba797c
commit
aeb0109159
1 changed files with 19 additions and 2 deletions
|
@ -1432,18 +1432,35 @@
|
|||
(test 'def (read (open-input-string "#; abc def")))
|
||||
(test 'def (read (open-input-string "; abc \ndef")))
|
||||
(test 'def (read (open-input-string "#| abc |# def")))
|
||||
(test 'ghi (read (open-input-string "#| abc #| def |# |# ghi")))
|
||||
(test 'ghi (read (open-input-string "#; ; abc\n def ghi")))
|
||||
|
||||
(test #\a (read (open-input-string "#\\a")))
|
||||
(test #\space (read (open-input-string "#\\space")))
|
||||
(test #\alarm (read (open-input-string "#\\alarm")))
|
||||
(test #\λ (read (open-input-string "#\\x03BB")))
|
||||
(test 0 (char->integer (read (open-input-string "#\\null"))))
|
||||
(test 7 (char->integer (read (open-input-string "#\\alarm"))))
|
||||
(test 8 (char->integer (read (open-input-string "#\\backspace"))))
|
||||
(test 9 (char->integer (read (open-input-string "#\\tab"))))
|
||||
(test 10 (char->integer (read (open-input-string "#\\newline"))))
|
||||
(test 13 (char->integer (read (open-input-string "#\\return"))))
|
||||
(test #x7F (char->integer (read (open-input-string "#\\delete"))))
|
||||
(test #x1B (char->integer (read (open-input-string "#\\escape"))))
|
||||
(test #x03BB (char->integer (read (open-input-string "#\\λ"))))
|
||||
(test #x03BB (char->integer (read (open-input-string "#\\x03BB"))))
|
||||
|
||||
(test "abc" (read (open-input-string "\"abc\"")))
|
||||
(test "abc" (read (open-input-string "\"abc\" \"def\"")))
|
||||
(test "ABC" (read (open-input-string "\"ABC\"")))
|
||||
(test "Hello" (read (open-input-string "\"H\\x65;llo\"")))
|
||||
(test 7 (char->integer (string-ref (read (open-input-string "\"\\a\"")) 0)))
|
||||
(test 8 (char->integer (string-ref (read (open-input-string "\"\\b\"")) 0)))
|
||||
(test 9 (char->integer (string-ref (read (open-input-string "\"\\t\"")) 0)))
|
||||
(test 10 (char->integer (string-ref (read (open-input-string "\"\\n\"")) 0)))
|
||||
(test 13 (char->integer (string-ref (read (open-input-string "\"\\r\"")) 0)))
|
||||
(test #x22 (char->integer (string-ref (read (open-input-string "\"\\\"\"")) 0)))
|
||||
(test #x7C (char->integer (string-ref (read (open-input-string "\"\\|\"")) 0)))
|
||||
(test "line 1\nline 2\n" (read (open-input-string "\"line 1\nline 2\n\"")))
|
||||
(test #x03BB (char->integer (string-ref (read (open-input-string "\"\\x03BB;\"")) 0)))
|
||||
|
||||
;; Numeric syntax adapted from Peter Bex's tests.
|
||||
;;
|
||||
|
|
Loading…
Add table
Reference in a new issue