package testutils
import "github.com/irfansharif/solver/internal/testutils"
Index ¶
- func Compile(tb testing.TB, input string) *ast.Statement
- type Scanner
- func NewScanner(t *testing.T, r io.Reader, name string, line int) *Scanner
- func (s *Scanner) Error(args ...interface{})
- func (s *Scanner) Errorf(format string, args ...interface{})
- func (s *Scanner) Fatal(args ...interface{})
- func (s *Scanner) Fatalf(format string, args ...interface{})
- func (s *Scanner) Log(args ...interface{})
- func (s *Scanner) Logf(format string, args ...interface{})
- func (s *Scanner) Scan() bool
Functions ¶
func Compile ¶
Compile compiles the given statement and returns the corresponding AST node.
Types ¶
type Scanner ¶
Scanner is a convenience wrapper around a bufio.Scanner that keeps track of the last read line number. It also:
- captures an associated name for the reader (typically a file name) to generate positional error messages.
- embeds a *testing.T to automatically record errors with the position it corresponds to.
func NewScanner ¶
func (*Scanner) Error ¶
func (s *Scanner) Error(args ...interface{})
Error is thin wrapper around testing.T's interface.
func (*Scanner) Errorf ¶
Errorf is thin wrapper around testing.T's interface.
func (*Scanner) Fatal ¶
func (s *Scanner) Fatal(args ...interface{})
Fatal is thin wrapper around testing.T's interface.
func (*Scanner) Fatalf ¶
Fatalf is thin wrapper around testing.T's interface.
func (*Scanner) Log ¶
func (s *Scanner) Log(args ...interface{})
Log is thin wrapper around testing.T's interface.
func (*Scanner) Logf ¶
Logf is thin wrapper around testing.T's interface.
func (*Scanner) Scan ¶
Scan is a thin wrapper around the bufio Scanner's interface.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
internal/testutils/bazel | |
internal/testutils/parser | Package parser contains the parsing primitives needed to process the datadriven tests. |
internal/testutils/parser/ast | |
internal/testutils/parser/lexer | |
internal/testutils/parser/token |
- Version
- v0.0.0-20220713194315-9c33ad307075 (latest)
- Published
- Jul 13, 2022
- Platform
- linux/amd64
- Imports
- 8 packages
- Last checked
- 3 weeks ago –
Tools for package owners.