aboutsummaryrefslogtreecommitdiff
path: root/tests/text.nom
blob: 2e08e4588881debf99f796235f10e1a2b80eb860 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#..
    Tests for the stuff defined in lib/text.nom

use "core"

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")

say "Text test passed."