summaryrefslogtreecommitdiff
path: root/combinator_test.go
diff options
context:
space:
mode:
authorAdam Scarr <adam@vektah.net>2017-08-13 17:30:10 +1000
committerAdam Scarr <adam@vektah.net>2017-08-13 18:56:23 +1000
commit5716ddb5e7ca3cb4ee445bdd4958c37aeb033baa (patch)
treea5d5017dbf1078220ceef24d9ea9432b33972291 /combinator_test.go
parent0dc37ae5bc10cc0669f88ab9febbc039a28f23d1 (diff)
Pass result in instead of returning
Diffstat (limited to 'combinator_test.go')
-rw-r--r--combinator_test.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/combinator_test.go b/combinator_test.go
index 1c95eba..c1eedb3 100644
--- a/combinator_test.go
+++ b/combinator_test.go
@@ -165,8 +165,8 @@ type htmlTag struct {
}
func TestMap(t *testing.T) {
- parser := Map(Seq("<", Chars("a-zA-Z0-9"), ">"), func(n Result) Result {
- return Result{Result: htmlTag{n.Child[1].Token}}
+ parser := Seq("<", Chars("a-zA-Z0-9"), ">").Map(func(n *Result) {
+ n.Result = htmlTag{n.Child[1].Token}
})
t.Run("success", func(t *testing.T) {
@@ -235,8 +235,8 @@ func TestMerge(t *testing.T) {
}
func TestMapShorthand(t *testing.T) {
- Chars("a-z").Map(func(n Result) Result {
- return Result{Result: n.Token}
+ Chars("a-z").Map(func(n *Result) {
+ n.Result = n.Token
})
}