Test Repeat success/failure

This commit is contained in:
2024-09-27 10:40:18 -06:00
parent 2d6f091e0b
commit 5e6eafef64
2 changed files with 24 additions and 2 deletions

View File

@ -26,3 +26,11 @@ func ErrReaderAt(err error) io.ReaderAt {
func StateIsAt[Input any](t test.T, s gigaparsec.State[Input], pos uint64) {
test.EqOp(t, pos, s.Pos(), test.Sprintf("expected parser state to be at position %d, got %d", pos, s.Pos()))
}
func SliceOfN[T any](value T, n int) []T {
s := make([]T, n)
for i := range s {
s[i] = value
}
return s
}