From f3a37f5fb6993ab46f5dc65ff9babd2fdefebcc8 Mon Sep 17 00:00:00 2001 From: Brandon Dyck Date: Wed, 16 Oct 2024 13:50:14 -0600 Subject: [PATCH] Test Regexp failure message --- bytes/regexp_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bytes/regexp_test.go b/bytes/regexp_test.go index 6c77b92..6f59306 100644 --- a/bytes/regexp_test.go +++ b/bytes/regexp_test.go @@ -58,7 +58,13 @@ func TestRegexp(t *testing.T) { test.ErrorIs(t, err, expectedErr) test.False(t, succeeded) }) - t.Run("returns a useful Got value", Todo) + t.Run("returns a useful Got value", func(t *testing.T) { + p := pbytes.Regexp("hello") + result, err := p(gigaparsec.MakeState(strings.NewReader("hellaparsec"))) + + must.NoError(t, err) + test.StrContains(t, result.Message().Got(), "hella") + }) } func TestRuneReader(t *testing.T) {