packagestest

package
v0.1.21 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 23 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 packagestest builds, for the tests, what package packages lays and reads: the packages of the vectors of spec's format, their archives, an index of them and a release of modules that serves them, and a folder laid from them, read as serve reads it (R41). The tests run without the network.

The vectors of packages hold no answer slot bound choice, so the package holds modules of its own too, synthetic, under modules/: choices, whose tasks a tap checks, with one that AI would read and one with a rubric.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Archive

func Archive(t testing.TB, files map[string][]byte, extra ...TarEntry) []byte

Archive is a package's archive as a release of modules gives it: its files, flat, and whatever extra a test adds.

func ArchiveName

func ArchiveName(d formatv0.Digest) string

ArchiveName is the name of the archive of the package of d in its release.

func Built

func Built(t testing.TB, name string, version ...string) *modulepackage.Package

Built is the package of the vector name of spec's format, which module-kit builds from its module (format/vectors/packages/); with version, the same module at that version, for a module with two.

func DigestOf

func DigestOf(data []byte) formatv0.Digest

DigestOf is the digest of data, as the format writes one.

func Index

func Index(t testing.TB, entries ...Entry) []byte

Index is a module index of the entries, as module-kit reads one.

func Own added in v0.1.15

func Own(t testing.TB, name string, version ...string) *modulepackage.Package

Own is the package of this package's own module name, under modules/; with version, the same module at that version.

func OwnEdited added in v0.1.18

func OwnEdited(t testing.TB, name, version string, edit func(path string, data []byte) []byte) *modulepackage.Package

OwnEdited is the package of this package's own module name at version, with each of its files as edit gives it back: a later version that changes the module, as one with retired skills.

func Set

func Set(t testing.TB, entries ...Entry) *packages.Set

Set is the folder of the entries, laid by Lay from a release that serves their packages, and read back as serve reads it at its start.

func TarGz

func TarGz(t testing.TB, entries []TarEntry) []byte

TarGz is the entries as a gzipped tar; a link points out of the package.

Types

type Entry

type Entry struct {
	Pkg       *modulepackage.Package
	ID        string
	Version   string
	Format    string
	Digest    formatv0.Digest
	Release   string
	Withdrawn string
}

Entry is an entry of a test's index: of a package built, or of a package that is not there — one of a format api does not read — by its fields.

type Release

type Release struct {
	// contains filtered or unexported fields
}

Release is the files of the releases of modules a test serves, by release and name, and what the server was asked for.

func (*Release) Asked

func (r *Release) Asked() []string

Asked is each path the server was asked for, in order.

func (*Release) Put

func (r *Release) Put(tag, name string, data []byte)

Put gives the file name in the release tag.

func (*Release) Remove

func (r *Release) Remove(tag, name string)

Remove takes the file name out of the release tag.

func (*Release) Serve

func (r *Release) Serve(t testing.TB) packages.Source

Serve serves the releases until the test ends, as the source Lay fetches from.

type TarEntry

type TarEntry struct {
	Name     string
	Data     []byte
	Typeflag byte
}

TarEntry is an entry of an archive: a regular file, a folder, or a link, which a test of a refusal puts there.

Jump to

Keyboard shortcuts

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