summaryrefslogtreecommitdiffstats
path: root/tests/012/const.tl
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-07-02 07:03:56 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-07-02 07:03:56 -0700
commita5a5a5ec30175f665a36fce9bc4abee1470ca274 (patch)
tree9b7590c1fcc32b370b5fd8c0db726c80f92c150e /tests/012/const.tl
parentdb03bc4a9fa34ebea017474e0760fef89de9d67f (diff)
downloadtxr-a5a5a5ec30175f665a36fce9bc4abee1470ca274.tar.gz
txr-a5a5a5ec30175f665a36fce9bc4abee1470ca274.tar.bz2
txr-a5a5a5ec30175f665a36fce9bc4abee1470ca274.zip
constantp: tests.
* tests/012/const.tl: New file.
Diffstat (limited to 'tests/012/const.tl')
-rw-r--r--tests/012/const.tl23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/012/const.tl b/tests/012/const.tl
new file mode 100644
index 00000000..e0235e30
--- /dev/null
+++ b/tests/012/const.tl
@@ -0,0 +1,23 @@
+(load "../common")
+
+(mtest
+ (constantp nil) t
+ (constantp t) t
+ (constantp :key) t
+ (constantp 'a) nil)
+
+(mtest
+ (constantp ''a) t
+ (constantp '(+)) t
+ (constantp '(+ 2)) t
+ (constantp '(+ 2 2)) t)
+
+(mtest
+ (constantp '(+ a)) nil
+ (constantp '(+ (* 2 2) (* 3 3))) t
+ (constantp '(+ (* 2 2) (* 3 a))) nil)
+
+(mtest
+ (constantp '(list 1 2 3)) nil
+ (constantp '(symacrolet ((a 1)) (+ a))) t
+ (constantp '(let ((a 1)) (+ a))) nil)