From 11f2532db434ede7bb725e62548fef7e6f6e1343 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Thu, 16 Nov 2023 15:34:27 +0000 Subject: 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. --- tests/yaml.scm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tests') 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") -- cgit v1.2.3