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
- func ReadList(path string) ([]string, error)
- type Fataler
- type Subset
- func (s Subset) Filter(rel []string) []string
- func (s Subset) FilterPaths(examplesDir string, paths []string) []string
- func (s Subset) Name() string
- func (s Subset) Recording(flag string) error
- func (s Subset) Wants(rel string) bool
- func (s Subset) WantsAny(examplesDir string, paths []string) bool
- func (s Subset) WantsPath(examplesDir, path string) bool
- func (s Subset) Whole() bool
Constants ¶
const ConstructCover = "construct-cover"
ConstructCover names the committed subset that covers every syntactic construct the whole corpus exhibits, recorded by TestConstructCover.
const EnvVar = "OPENSYSML_CORPUS_SUBSET"
EnvVar selects the subset of examples/ a sweep iterates.
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 ¶
Types ¶
type Subset ¶
type Subset struct {
// contains filtered or unexported fields
}
Subset is the set of examples/ files a sweep iterates.
func Load ¶
Load reads OPENSYSML_CORPUS_SUBSET and, for the construct-cover subset, the committed list under repoRoot. An unset variable selects the whole corpus.
func (Subset) Filter ¶
Filter keeps the examples/-relative paths of rel this subset iterates, in order.
func (Subset) FilterPaths ¶
FilterPaths keeps the paths this subset iterates, in order: those under examplesDir that are listed, and every path outside it.
func (Subset) Recording ¶
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 ¶
Wants reports whether the examples/-relative, slash-separated path rel is iterated. Under the whole corpus every path is.
func (Subset) WantsAny ¶
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.