loaderrtest

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package loaderrtest checks, in a loader's tests, that its errors are *loaderr.Error values an agent can act on: they name the file, the line and a fix.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Expect

func Expect(t testing.TB, err error, file string, line int) *loaderr.Error

Expect fails t unless err holds a *loaderr.Error whose File is file, whose Line is line, whose Fix is set and whose message starts with "file:line:". It returns that Error for further checks.

func ExpectField

func ExpectField(t testing.TB, err error, file string, data []byte, field string) *loaderr.Error

ExpectField is Expect for an error about field in data, the document the loader read: it checks that the error names field and points at the line FindField finds for it, which is 1 for the document as a whole.

func Indent

func Indent(data string) []byte

Indent returns the JSON document data indented one field per line, so a test of a single-line document checks lines that differ from field to field. It returns data unchanged when data is not valid JSON.

Types

This section is empty.

Jump to

Keyboard shortcuts

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