diff options
author | Adam Scarr <adam@vektah.net> | 2017-08-08 23:11:47 +1000 |
---|---|---|
committer | Adam Scarr <adam@vektah.net> | 2017-08-08 23:11:47 +1000 |
commit | acd48fdfa4653dbeffd41f6b773ae4552e6c55bc (patch) | |
tree | c65e965b0bf88ccd28f657f11c36b7e73d3eaea2 /combinator_test.go | |
parent | ef04f70d750e8e447e096ac7ffb49d8831008a9c (diff) |
Add readme and calc example
Diffstat (limited to 'combinator_test.go')
-rw-r--r-- | combinator_test.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/combinator_test.go b/combinator_test.go index 4ac96b1..401c5d6 100644 --- a/combinator_test.go +++ b/combinator_test.go @@ -140,7 +140,7 @@ type htmlTag struct { func TestMap(t *testing.T) { parser := Map(And("<", Chars("a-zA-Z0-9"), ">"), func(n Node) Node { - return Node{Result: htmlTag{n.Children[1].Token}} + return Node{Result: htmlTag{n.Child[1].Token}} }) t.Run("sucess", func(t *testing.T) { @@ -182,7 +182,7 @@ func assertSequence(t *testing.T, node Node, expected ...string) { require.NotNil(t, node) actual := []string{} - for _, child := range node.Children { + for _, child := range node.Child { actual = append(actual, child.Token) } |