From 9bc60a23116a1992e56d3a2754df6523bc565e99 Mon Sep 17 00:00:00 2001 From: Özgür Kesim Date: Tue, 18 Jun 2019 13:21:21 +0200 Subject: applying upstream patch for github.com/vektah/goparsify/issues/3 --- combinator_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'combinator_test.go') 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) { -- cgit v1.2.3