Added MatchString
This commit is contained in:
@ -6,7 +6,9 @@ package test
|
||||
import (
|
||||
"io"
|
||||
|
||||
"git.codemonkeysoftware.net/b/gigaparsec"
|
||||
"git.codemonkeysoftware.net/b/gigaparsec/cursor"
|
||||
"github.com/shoenig/test"
|
||||
)
|
||||
|
||||
type errReaderAt struct {
|
||||
@ -44,3 +46,7 @@ func (c errCursor[T]) Pos() uint64 {
|
||||
func ErrCursor[T any](err error) cursor.Cursor[T] {
|
||||
return errCursor[T]{err: err}
|
||||
}
|
||||
|
||||
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()))
|
||||
}
|
||||
|
Reference in New Issue
Block a user