diff options
author | Adam Scarr <adam@vektah.net> | 2017-08-09 22:14:27 +1000 |
---|---|---|
committer | Adam Scarr <adam@vektah.net> | 2017-08-09 22:14:27 +1000 |
commit | b64fcfaa6115eb4a5f65c12d37f95d842136ae35 (patch) | |
tree | ceb8a55f3c538a263ab96563be7edec898518661 /parser_test.go | |
parent | d285a0badc988be2cef6e01d224bf8f108bb33bb (diff) |
Add a unicode whitespace parser
Diffstat (limited to 'parser_test.go')
-rw-r--r-- | parser_test.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/parser_test.go b/parser_test.go index 09cf7f4..bc2867e 100644 --- a/parser_test.go +++ b/parser_test.go @@ -203,6 +203,15 @@ func TestAutoWS(t *testing.T) { require.Equal(t, "hello", result.Child[1].Token) require.Equal(t, "", ps.Get()) }) + + t.Run("unicode whitespace", func(t *testing.T) { + ps := NewState(" \u202f hello") + ps.WS = UnicodeWhitespace + + result := Exact("hello")(ps) + require.Equal(t, "hello", result.Token) + require.False(t, ps.Errored()) + }) } func runParser(input string, parser Parser) (Result, *State) { |