spectest

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package spectest loads the pinned protocol specs for tests.

Index

Constants

View Source
const DirEnv = "ETHER_CONFORM_SPECS_DIR"

DirEnv names the directory that holds the fetched specs (internal/conform/specs/fetch.sh <dir>). When it is set, a missing spec fails the test instead of skipping validation: CI sets it after fetching, so validation can never silently drop out there.

Variables

This section is empty.

Functions

func Bytes

func Bytes(tb testing.TB, protocol string) []byte

Bytes returns the raw checksum-verified spec under the same rules as Document (it is parsed too, so a malformed spec still fails).

func Document

func Document(tb testing.TB, protocol string) *openapi.Document

Document returns the parsed, checksum-verified pinned spec for protocol. It returns nil only when the spec is not cached and DirEnv is unset, so the caller skips schema validation (and says so in the test log). Every other problem — a checksum mismatch, an unreadable file, a parse error, or a missing spec when DirEnv is set — fails the test.

Types

This section is empty.

Jump to

Keyboard shortcuts

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