Result is failed by default

This commit is contained in:
2024-09-13 10:44:30 -06:00
parent 0a149acf46
commit 7c7d0fef9b
3 changed files with 21 additions and 20 deletions

View File

@ -56,8 +56,10 @@ func TestSlice(t *testing.T) {
r := ptest.ErrReaderAt(expectedErr)
c := cursor.NewReaderAt(r)
s := rapid.SliceOfN(rapid.Byte(), 0, 100).Draw(t, "s")
_, err := gigaparsec.Slice(s)(gigaparsec.MakeState(c))
result, err := gigaparsec.Slice(s)(gigaparsec.MakeState(c))
failed, _, _ := result.Failed()
test.ErrorIs(t, err, expectedErr)
test.True(t, failed)
}))
t.Run("succeeds when contents match", rapid.MakeCheck(func(t *rapid.T) {
input := rapid.SliceOfN(rapid.Byte(), 1, -1).Draw(t, "input")