diff options
author | Adam Scarr <adam@vektah.net> | 2017-08-13 12:56:46 +1000 |
---|---|---|
committer | Adam Scarr <adam@vektah.net> | 2017-08-13 13:00:22 +1000 |
commit | 77930f8f066b058c7e6cbae015523370ca3dab7e (patch) | |
tree | fd0e4e3663f1183633fb16be297a20764a38d37c /combinator_test.go | |
parent | f5b81e8e2eebd06e79159eaa3e721ac59ba3cc8c (diff) |
Add map shorthand
Diffstat (limited to 'combinator_test.go')
-rw-r--r-- | combinator_test.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/combinator_test.go b/combinator_test.go index b197105..50b7010 100644 --- a/combinator_test.go +++ b/combinator_test.go @@ -199,6 +199,12 @@ func TestMerge(t *testing.T) { }) } +func TestMapShorthand(t *testing.T) { + Chars("a-z").Map(func(n Result) Result { + return Result{Result: n.Token} + }) +} + func assertSequence(t *testing.T, node Result, expected ...string) { require.NotNil(t, node) actual := []string{} |