assertions

package
v0.0.0-...-3483356 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AssertionPrefix                  = "##"
	NbAssertionComponents            = 6
	NbAssertionComponentsWithErrName = 7
)

Variables

View Source
var (
	ErrInvalidNbComponents = errors.New("invalid number of components")
	ErrInvalidAssertion    = errors.New("invalid assertion")
	ErrInvalidGroup        = errors.New("invalid group")
	ErrInvalidKey          = errors.New("invalid key")
	ErrInvalidLineNumber   = errors.New("invalid line number")
	ErrInvalidColumnNumber = errors.New("invalid column number")
)

Functions

This section is empty.

Types

type Assertion

type Assertion struct {
	Type        AssertionType
	ErrCategory string
	ErrName     string
	Group       string
	Key         string
	Line        int
	Column      int
}

func ParseAssertionFromLine

func ParseAssertionFromLine(line string) (Assertion, error)

type AssertionType

type AssertionType string
const (
	AssertError AssertionType = "assert-error"
)

func ParseAssertionType

func ParseAssertionType(assertion string) (AssertionType, error)

type Assertions

type Assertions []Assertion

func ParseAndReadAssertions

func ParseAndReadAssertions(filename string) (model.UnitFile, Assertions, error)

func (Assertions) RunAssertions

func (a Assertions) RunAssertions(t *testing.T, errors []V.ValidationError)

Jump to

Keyboard shortcuts

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