summaryrefslogtreecommitdiffstats
path: root/tests/012/readprint.tl
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-03-23 00:55:46 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-03-23 00:55:46 -0700
commitc6a32a5aafa0b85318ef1262f464ba270e3da71c (patch)
tree162771f2a6561901078cc6cc12b88e5be3f4fecb /tests/012/readprint.tl
parent0d8638e43da65169c3d46273c6c9c8239f54723f (diff)
downloadtxr-c6a32a5aafa0b85318ef1262f464ba270e3da71c.tar.gz
txr-c6a32a5aafa0b85318ef1262f464ba270e3da71c.tar.bz2
txr-c6a32a5aafa0b85318ef1262f464ba270e3da71c.zip
printer: [] shouldn't print as [. nil].
* lib.c (obj_print_impl): In the case when dwim has no args, and the logic short circuits to a closing brace, bypassing the loop, we should only use the dot notation if the terminating atom is other than nil. * tests/012/readprint.tl: Tests added.
Diffstat (limited to 'tests/012/readprint.tl')
-rw-r--r--tests/012/readprint.tl8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/012/readprint.tl b/tests/012/readprint.tl
index cf70320a..4298a85b 100644
--- a/tests/012/readprint.tl
+++ b/tests/012/readprint.tl
@@ -4,4 +4,10 @@
'[ . a] "[. a]"
'[. a] "[. a]"
'[ . @a] "[. @a]"
- '[. @a] "[. @a]")
+ '[. @a] "[. @a]"
+ '[] "[]"
+ '[. 3] "[. 3]"
+ '[3 . 4] "[3 . 4]"
+ '(dwim) "[]"
+ '(dwim . 3) "[. 3]"
+ '(dwim 3 . 4) "[3 . 4]")