From 77930f8f066b058c7e6cbae015523370ca3dab7e Mon Sep 17 00:00:00 2001 From: Adam Scarr Date: Sun, 13 Aug 2017 12:56:46 +1000 Subject: Add map shorthand --- combinator_test.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'combinator_test.go') 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{} -- cgit v1.2.3