asttest

package
v0.33.2 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package asttest implements utilities for testing the abstract syntax tree.

Index

Constants

This section is empty.

Variables

View Source
var CmpOptions = []cmp.Option{
	cmp.Comparer(func(x, y *regexp.Regexp) bool {
		if x == nil && y == nil {
			return true
		}
		if x == nil || y == nil {
			return false
		}
		return x.String() == y.String()
	}),
}
View Source
var CompareOptions = append(IgnoreBaseNodeOptions,
	cmp.Comparer(func(x, y *regexp.Regexp) bool { return x.String() == y.String() }),
)
View Source
var IgnoreBaseNodeOptions = []cmp.Option{
	cmpopts.IgnoreFields(ast.ArrayExpression{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.BadStatement{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.BinaryExpression{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.Block{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.BooleanLiteral{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.BuiltinStatement{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.CallExpression{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.ConditionalExpression{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.DateTimeLiteral{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.DurationLiteral{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.ExpressionStatement{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.File{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.FloatLiteral{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.FunctionExpression{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.Identifier{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.ImportDeclaration{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.IndexExpression{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.IntegerLiteral{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.LogicalExpression{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.MemberAssignment{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.MemberExpression{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.ObjectExpression{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.OptionStatement{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.Package{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.PackageClause{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.PipeExpression{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.PipeLiteral{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.Property{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.RegexpLiteral{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.ReturnStatement{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.StringLiteral{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.TestStatement{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.UnaryExpression{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.UnsignedIntegerLiteral{}, "BaseNode"),
	cmpopts.IgnoreFields(ast.VariableAssignment{}, "BaseNode"),
}

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmpgen generates comparison options for the asttest package.
cmpgen generates comparison options for the asttest package.

Jump to

Keyboard shortcuts

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