test

package
v0.35.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package test provides common functions for testing.

Index

Constants

This section is empty.

Variables

View Source
var UpdateOut = flag.Bool("update", false, "Update the example files in test/data and test/data/out")

UpdateOut is a flag that can be set to update example files

Functions

func Certificate added in v0.32.0

func Certificate(t *testing.T) *xmldsig.Certificate

Certificate loads the persisted test certificate from test/certs/test.p12.

func LoadEnvelope

func LoadEnvelope(file string) *gobl.Envelope

LoadEnvelope loads a test file from the test/data folder as a GOBL envelope and will rebuild it if necessary to ensure any changes are accounted for.

func LoadInvoice

func LoadInvoice(name string) (*gobl.Envelope, *bill.Invoice)

LoadInvoice will load the GOBL Envelope and extract the invoice, returning both the Envelope and Invoice objects.

func LoadSchema added in v0.32.0

func LoadSchema(name string) (*xsd.Schema, error)

LoadSchema loads an XSD schema from the test/schema directory

func LoadStatus added in v0.32.0

func LoadStatus(name string) (*gobl.Envelope, *bill.Status)

LoadStatus will load the GOBL Envelope and extract the status, returning both the Envelope and Status objects.

func Path

func Path(elements ...string) string

Path joins the provided elements to the project root

func RootPath

func RootPath() string

RootPath returns the project root, regardless of current working directory.

func ValidateXML added in v0.32.0

func ValidateXML(schema *xsd.Schema, doc []byte) []error

ValidateXML validates an XML document against an XSD schema

Types

This section is empty.

Jump to

Keyboard shortcuts

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