selection

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT 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 selection evaluates "go test -run" and "-skip" patterns the same way the testing package does. apitest needs this before running a case, because a filtered subtest is never started, but its preconditions must still run (FR-GO-02).

The logic mirrors testing/match.go (Go 1.27): a pattern is split at "/" and "|" outside of brackets and parentheses; every element is a regular expression for the name element at the same level.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

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

Filter decides whether a test name is selected.

func FromFlags

func FromFlags() (*Filter, error)

FromFlags builds a filter from the flags of the running test binary.

func New

func New(run, skip string) (*Filter, error)

New builds a filter from -run and -skip patterns. Empty patterns select everything and skip nothing.

func (*Filter) Selected

func (f *Filter) Selected(fullName string) bool

Selected reports whether the test with the full name (elements separated by "/") would run.

Jump to

Keyboard shortcuts

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