diff options
author | Arun Isaac | 2021-02-27 19:47:47 +0530 |
---|---|---|
committer | Arun Isaac | 2021-02-27 19:47:47 +0530 |
commit | d475760dfbbc0a3bb2732a924b006e68f6dcc065 (patch) | |
tree | f7381f6ff25ef3b91806e66dacef3bc7425e6292 /tests | |
parent | 52980a641e7434cb7610d7c857df6f1482bd07ec (diff) | |
download | ccwl-d475760dfbbc0a3bb2732a924b006e68f6dcc065.tar.gz ccwl-d475760dfbbc0a3bb2732a924b006e68f6dcc065.tar.lz ccwl-d475760dfbbc0a3bb2732a924b006e68f6dcc065.zip |
Display dictionary entries with empty values on the same line.
* ccwl/yaml.scm (display-dictionary-entry): If value is an empty array
or dictionary, display it on the same line.
(scm->yaml): Go to next line after printing empty array.
* tests/yaml.scm: New file.
* tests/yaml.scm ("dictionary entries with empty arrays and
dictionaries for values must render on the same line"): New test case.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/yaml.scm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/yaml.scm b/tests/yaml.scm new file mode 100644 index 0000000..767cdff --- /dev/null +++ b/tests/yaml.scm @@ -0,0 +1,14 @@ +(use-modules (ccwl yaml) + (srfi srfi-64)) + +(test-begin "yaml") + +(test-equal "dictionary entries with empty arrays and dictionaries for values must render on the same line" + (scm->yaml-string + '((foo . #()) + (bar))) + "foo: [] +bar: {} +") + +(test-end "yaml") |