diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-06-30 01:12:42 +0200 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2022-07-07 21:17:22 +0200 |
commit | f540b9a751cf116512ba8bef1d676cea90bad8fa (patch) | |
tree | 9a3fda71e5541d19feb3a10d65d7b9a957bb5aa7 /tests/test | |
parent | C parser add unary minus. (diff) | |
download | calp-f540b9a751cf116512ba8bef1d676cea90bad8fa.tar.gz calp-f540b9a751cf116512ba8bef1d676cea90bad8fa.tar.xz |
Char parse tests, these were broken by strings.
Diffstat (limited to 'tests/test')
-rw-r--r-- | tests/test/cpp.scm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/test/cpp.scm b/tests/test/cpp.scm index 2cb4266d..2c51f616 100644 --- a/tests/test/cpp.scm +++ b/tests/test/cpp.scm @@ -412,6 +412,14 @@ num)) (run form)))) +(test-group "Characters" + (let ((form "'c'")) + (test-equal '(char "c") (lex form)) + (test-equal #x63 (run form))) + + (let ((form "'\\n'")) + (test-equal '(char (escaped-char "n")) (lex form)) + (test-equal (char->integer #\newline) (run form)))) (test-group "Strings" (test-group "Empty string" |