aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArun Isaac2023-11-16 15:34:27 +0000
committerArun Isaac2023-11-16 15:39:33 +0000
commit11f2532db434ede7bb725e62548fef7e6f6e1343 (patch)
tree9e160a121e9309d93c6b401c18aea8fdf70c4b6c /tests
parent900c76a29726778a34ba0cbeb832cddd618783f4 (diff)
downloadccwl-11f2532db434ede7bb725e62548fef7e6f6e1343.tar.gz
ccwl-11f2532db434ede7bb725e62548fef7e6f6e1343.tar.lz
ccwl-11f2532db434ede7bb725e62548fef7e6f6e1343.zip
yaml: Display arrays with a single atomic element on the same line.
* ccwl/yaml.scm (atom?): New function. (display-dictionary-entry, scm->yaml): Display arrays with a single atomic element on the same line. * tests/yaml.scm ("strings with hyphen characters should be escaped", "strings with asterisk characters should be escaped"): Update tests with new behaviour. ("single element vectors must be serialized on the same line"): New test.
Diffstat (limited to 'tests')
-rw-r--r--tests/yaml.scm11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/yaml.scm b/tests/yaml.scm
index 545b49c..d3d01c2 100644
--- a/tests/yaml.scm
+++ b/tests/yaml.scm
@@ -31,12 +31,19 @@ bar: {}
(test-equal "strings with hyphen characters should be escaped"
"- \"-1\"
+- \"-2\"
"
- (scm->yaml-string #("-1")))
+ (scm->yaml-string #("-1" "-2")))
(test-equal "strings with asterisk characters should be escaped"
"- \"*foo\"
+- \"*bar\"
"
- (scm->yaml-string #("*foo")))
+ (scm->yaml-string #("*foo" "*bar")))
+
+(test-equal "single element vectors must be serialized on the same line"
+ "[foo]
+"
+ (scm->yaml-string #("foo")))
(test-end "yaml")