diff options
-rw-r--r-- | ccwl/yaml.scm | 3 | ||||
-rw-r--r-- | tests/yaml.scm | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/ccwl/yaml.scm b/ccwl/yaml.scm index 00942de..a33a88f 100644 --- a/ccwl/yaml.scm +++ b/ccwl/yaml.scm @@ -79,8 +79,9 @@ serialized to YAML. Else, return @code{#f}." ;; Display on the same line if value is ;; - an empty array ;; - an empty dictionary + ;; - an atom ;; - an array with an atom as its only element - ((or #() () #((? atom? _))) + ((or #() () (? atom? _) #((? atom? _))) (display " " port) (scm->yaml value port level)) ;; Else, display it on the next line. diff --git a/tests/yaml.scm b/tests/yaml.scm index d3d01c2..f1cc7ea 100644 --- a/tests/yaml.scm +++ b/tests/yaml.scm @@ -46,4 +46,9 @@ bar: {} " (scm->yaml-string #("foo"))) +(test-equal "dictionary keys that map to an atomic value must be serialized on the same line" + "foo: bar +" + (scm->yaml-string '((foo . bar)))) + (test-end "yaml") |