summaryrefslogtreecommitdiff
path: root/combinator_test.go
diff options
context:
space:
mode:
authorÖzgür Kesim <oec@codeblau.de>2019-06-18 13:41:06 +0200
committerÖzgür Kesim <oec@codeblau.de>2019-06-18 13:41:06 +0200
commitef954d857ce5a6e9952f7d6487662b6b164a127c (patch)
treec2d766cb03902bd03466b12a8e69ad8cc3087581 /combinator_test.go
parent6b9cd80df517fd7d85a256a950f3de726d7e619e (diff)
parent9bc60a23116a1992e56d3a2754df6523bc565e99 (diff)
Merge branch 'master' of github.com:/oec/goparsify
Diffstat (limited to 'combinator_test.go')
-rw-r--r--combinator_test.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/combinator_test.go b/combinator_test.go
index b315b37..17a0c11 100644
--- a/combinator_test.go
+++ b/combinator_test.go
@@ -88,6 +88,17 @@ func TestAny(t *testing.T) {
})
})
+
+ // see https://github.com/vektah/goparsify/issues/3
+ t.Run("doesn't succeed early after caller error", func(t *testing.T) {
+ str := "str"
+ str1 := Seq("str", "1")
+ str2 := Any("str2")
+ p := Any(str1, str2, str)
+ _, ps := runParser("str", p)
+ require.False(t, ps.Errored())
+ require.Equal(t, "", ps.Get())
+ })
}
func TestSome(t *testing.T) {