diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-01-26 20:20:12 -0800 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-01-26 20:20:38 -0800 |
| commit | 90c56d31352a0eeccd382ef5921baf3af4971040 (patch) | |
| tree | 5167eafb5785c94b48458b18b0454222ca70c749 /tests/text.nom | |
| parent | d5aa4e52983712f9f4c5b23528d0c2dab12b0b33 (diff) | |
Added a ton of tests for virtually all the functionality. Helped me find
and fix a lot of latent problems.
Diffstat (limited to 'tests/text.nom')
| -rw-r--r-- | tests/text.nom | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/text.nom b/tests/text.nom new file mode 100644 index 0000000..ea18d42 --- /dev/null +++ b/tests/text.nom @@ -0,0 +1,13 @@ +#.. + Tests for the stuff defined in lib/text.nom + +use "lib/core.nom" + +assume ((["x","y"] joined with ",") = "x,y") or barf "joined with failed" +assume ((["x","y"] joined) = "xy") or barf "joined failed" +assume (("asdf" capitalized) = "Asdf") or barf "capitalized failed" +assume (("asdf" with "X" instead of "s") = "aXdf") or barf "substitution failed" +# TODO: add tests for indent/dedent +assume ("\n" = (newline)) or barf "Text literals failed." +%x <- "\(green)hello\(reset color)" +assume (("x" + "y") = "xy") |
