pubtest

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: AGPL-3.0 Imports: 5 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 pubtest builds pub package archives for tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(tb TB, s Spec) []byte

Build returns a valid archive of s.

func Pubspec

func Pubspec(s Spec) string

Pubspec returns the pubspec.yaml the archive of s carries.

func Tar

func Tar(tb TB, entries []Entry) []byte

Tar returns the gzip-compressed tar of entries.

Types

type Entry

type Entry struct {
	Name string
	Body []byte
	// Type is the tar type flag; 0 means a regular file.
	Type byte
}

Entry is one tar entry.

func Entries

func Entries(s Spec) []Entry

Entries returns the entries of a valid archive of s.

type Spec

type Spec struct {
	Name, Version string
	// Pubspec replaces the generated pubspec.yaml when not empty.
	Pubspec string
	// Files are extra files (path to content) of the archive.
	Files map[string]string
}

Spec describes a package.

type TB

type TB interface {
	Helper()
	Fatal(args ...any)
}

TB is the part of testing.TB the builders use, which fuzz targets satisfy too.

Jump to

Keyboard shortcuts

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