utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const ImportedLocation = ast.StringLocation("imported")

ImportedLocation is used as the default location for imported programs in tests.

View Source
const TestLocation = ast.StringLocation("test")

TestLocation is used as the default location for programs in tests.

Variables

This section is empty.

Functions

func AssertEqualWithDiff

func AssertEqualWithDiff(t *testing.T, expected, actual interface{})

AssertEqualWithDiff asserts that two objects are equal.

If the objects are not equal, this function prints a human-readable diff.

func ExpectCheckerErrors

func ExpectCheckerErrors(t *testing.T, err error, len int) []error

func ParseAndCheck

func ParseAndCheck(t *testing.T, code string) (*sema.Checker, error)

func ParseAndCheckWithOptions

func ParseAndCheckWithOptions(
	t *testing.T,
	code string,
	options ParseAndCheckOptions,
) (*sema.Checker, error)

Types

type OccurrenceMatcher

type OccurrenceMatcher struct {
	StartPos        sema.Position
	EndPos          sema.Position
	OriginStartPos  *sema.Position
	OriginEndPos    *sema.Position
	DeclarationKind common.DeclarationKind
}

func (*OccurrenceMatcher) Match

func (matcher *OccurrenceMatcher) Match(actual interface{}) bool

type ParseAndCheckOptions

type ParseAndCheckOptions struct {
	ImportResolver ast.ImportResolver
	Location       ast.Location
	Options        []sema.Option
}

Jump to

Keyboard shortcuts

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