testutils

package
v0.0.0-...-9b02bcc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compile

func Compile(tb testing.TB, input string) *ast.Statement

Compile compiles the given statement and returns the corresponding AST node.

Types

type Scanner

type Scanner struct {
	*testing.T
	*bufio.Scanner
	// contains filtered or unexported fields
}

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 NewScanner(t *testing.T, r io.Reader, name string, line int) *Scanner

func (*Scanner) Error

func (s *Scanner) Error(args ...interface{})

Error is thin wrapper around testing.T's interface.

func (*Scanner) Errorf

func (s *Scanner) Errorf(format string, args ...interface{})

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

func (s *Scanner) Fatalf(format string, args ...interface{})

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

func (s *Scanner) Logf(format string, args ...interface{})

Logf is thin wrapper around testing.T's interface.

func (*Scanner) Scan

func (s *Scanner) Scan() bool

Scan is a thin wrapper around the bufio Scanner's interface.

Directories

Path Synopsis
Package parser contains the parsing primitives needed to process the datadriven tests.
Package parser contains the parsing primitives needed to process the datadriven tests.
ast

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL