diff options
| author | Baptiste Daroussin <bapt@FreeBSD.org> | 2025-06-25 15:13:45 +0000 |
|---|---|---|
| committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2025-06-25 15:14:13 +0000 |
| commit | 5f99da5545ebe3c081dc126e00ec7d801db9c772 (patch) | |
| tree | e692d78fdb6bc34a660e9e586c121e03afb8b5ff /tests/ReadMe.md | |
| parent | 5c7ba42d2e90bdd94bb55c80d0787e998fad44f9 (diff) | |
Diffstat (limited to 'tests/ReadMe.md')
| -rw-r--r-- | tests/ReadMe.md | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/tests/ReadMe.md b/tests/ReadMe.md new file mode 100644 index 000000000000..bf09447f53f3 --- /dev/null +++ b/tests/ReadMe.md @@ -0,0 +1,63 @@ +# Testing the Parser and Emitter + +There are several programs to test the parser and emitter. + +## Parser + + echo 'foo: bar' | ./tests/run-parser-test-suite + +This will output the parsing events in yaml-test-suite format: + + +STR + +DOC + +MAP + =VAL :foo + =VAL :bar + -MAP + -DOC + -STR + +For flow style events, you have to enable it with the `--flow` option: + + echo '{ foo: bar }' | ./tests/run-parser-test-suite --flow keep + + ... + +MAP {} + ... + +In the future, this will be the default. + +You can also explicitly disable this style with `--flow off`, or output +flow style always, with `--flow on`. + +## Emitter + +run-emitter-test-suite takes yaml-test-suite event format and emits YAML. + + ./tests/run-parser-test-suite ... | ./tests/run-emitter-test-suite + +## Options + +* `--directive (1.1|1.2)` + + Prints a version directive before every document. + +* `--flow on` + + Will emit the whole document in flow style. + +* `--flow off` + + Will emit the whole document in block style. + +* `--flow keep` + + Will emit block/flow style like in the original document. + +Example: +``` +% echo 'foo: [bar, {x: y}]' | + ./tests/run-parser-test-suite --flow keep | + ./tests/run-emitter-test-suite --flow keep +foo: [bar, {x: y}] +``` |
