aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-06-30 01:12:42 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-07-07 21:17:22 +0200
commitf540b9a751cf116512ba8bef1d676cea90bad8fa (patch)
tree9a3fda71e5541d19feb3a10d65d7b9a957bb5aa7
parentC parser add unary minus. (diff)
downloadcalp-f540b9a751cf116512ba8bef1d676cea90bad8fa.tar.gz
calp-f540b9a751cf116512ba8bef1d676cea90bad8fa.tar.xz
Char parse tests, these were broken by strings.
-rw-r--r--tests/test/cpp.scm8
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"