corpussubset

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 6 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 corpussubset answers, for the tests that sweep every model under examples/, whether OPENSYSML_CORPUS_SUBSET makes this run iterate a file.

Index

Constants

View Source
const ConstructCover = "construct-cover"

ConstructCover names the committed subset that covers every syntactic construct the whole corpus exhibits, recorded by TestConstructCover.

View Source
const EnvVar = "OPENSYSML_CORPUS_SUBSET"

EnvVar selects the subset of examples/ a sweep iterates.

View Source
const ListPath = "tests/corpus/testdata/construct_cover.txt"

ListPath is the subset list, relative to the repository root: one sorted examples/-relative path per line, # lines being comments.

Variables

This section is empty.

Functions

func ReadList

func ReadList(path string) ([]string, error)

ReadList reads a subset list: one examples/-relative path per line, blank lines and # comments skipped. It is an error for the list to be unsorted or empty.

Types

type Fataler

type Fataler interface {
	Helper()
	Fatalf(format string, args ...any)
}

Fataler is the part of testing.TB that Must needs.

type Subset

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

Subset is the set of examples/ files a sweep iterates.

func Load

func Load(repoRoot string) (Subset, error)

Load reads OPENSYSML_CORPUS_SUBSET and, for the construct-cover subset, the committed list under repoRoot. An unset variable selects the whole corpus.

func Must

func Must(tb Fataler, repoRoot string) Subset

Must is Load for a test, failing it when the variable is unusable.

func (Subset) Filter

func (s Subset) Filter(rel []string) []string

Filter keeps the examples/-relative paths of rel this subset iterates, in order.

func (Subset) FilterPaths

func (s Subset) FilterPaths(examplesDir string, paths []string) []string

FilterPaths keeps the paths this subset iterates, in order: those under examplesDir that are listed, and every path outside it.

func (Subset) Name

func (s Subset) Name() string

Name is the value of OPENSYSML_CORPUS_SUBSET this subset was loaded from.

func (Subset) Recording

func (s Subset) Recording(flag string) error

Recording is the error a recorder flag fails with under a subset: an expectation recorded from a partial sweep would drop every unvisited file.

func (Subset) Wants

func (s Subset) Wants(rel string) bool

Wants reports whether the examples/-relative, slash-separated path rel is iterated. Under the whole corpus every path is.

func (Subset) WantsAny

func (s Subset) WantsAny(examplesDir string, paths []string) bool

WantsAny reports whether any of paths is iterated: a sweep whose unit is a directory of models iterates the whole directory when one of its files is listed.

func (Subset) WantsPath

func (s Subset) WantsPath(examplesDir, path string) bool

WantsPath is Wants for a path under examplesDir, however either is spelt. A path outside examplesDir is not part of the corpus and is always iterated.

func (Subset) Whole

func (s Subset) Whole() bool

Whole reports whether every file of the corpus is iterated.

Jump to

Keyboard shortcuts

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