testvec

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: AGPL-3.0, AGPL-3.0 Imports: 4 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 testvec reads the canonical cross-runtime fixtures in core/testvectors.

Keeping the sole vector authority inside the core module makes released module tests self-contained while Go and TypeScript still consume the exact same bytes. Callers provide paths because the envelope parser intentionally knows nothing about kind-specific schemas.

Index

Constants

View Source
const EnvelopeVersion = 1

EnvelopeVersion 是信封格式版本(与线协议版本、suiteByte 无关)。

Variables

View Source
var (
	ErrUnsupportedEnvelopeVersion = errors.New("testvec: unsupported envelope version")
	ErrMissingKind                = errors.New("testvec: envelope is missing kind")
	ErrMissingCaseName            = errors.New("testvec: case is missing name")
)

Functions

This section is empty.

Types

type Case

type Case struct {
	Name string
	// contains filtered or unexported fields
}

Case 提取公共的用例名,其余 kind 特定字段保留为原始 JSON 由消费方解码。

func (*Case) Decode

func (c *Case) Decode(v any) error

Decode 把用例的完整 JSON(含 name)解码进 kind 特定结构。

func (*Case) UnmarshalJSON

func (c *Case) UnmarshalJSON(data []byte) error

type File

type File struct {
	Version     int    `json:"version"`
	Kind        string `json:"kind"`
	Description string `json:"description"`
	Cases       []Case `json:"cases"`
}

File 是一个黄金向量文件的通用信封;Kind 决定 Cases 的具体 schema。

func Load

func Load(path string) (*File, error)

Load 读取并校验一个向量文件的信封;kind 特定内容不在此校验。

Jump to

Keyboard shortcuts

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