Built-in Test Sets

Types

There are a few available types:

TypeExplanation
functionFunctions which evaluate to another type upon compilation.
test setRepresents a set of tests.
numberPositive whole numbers.
stringUsed for patterns containing special characters.
patternSpecial syntax for test sets which operator on test identifiers.

A test set expression must always evaluate to a test set, otherwise it is ill-formed, all operators operate on test sets only. The following may be valid set(1) & set("aaa", 2), but set() & 1 is not. There is no arithmetic, and at the time of writing this literals like numbers and strings are included for future test set functionality.

Functions

The following functions are available, they can be written out in place of any expression.

NameExplanation
none()Includes no tests.
all()Includes all tests.
skip()Includes tests with a skip annotation
compile-only()Includes tests without references.
ephemeral()Includes tests with ephemeral references.
persistent()Includes tests with persistent references.

Patterns

Patterns are special types which are checked against identifiers and automatically turned into test sets. A pattern starts with a pattern type before a colon : and is either followed by a raw pattern or a string literal. Raw patterns don't have any delimiters and parse anything that's not whitespace. String patterns are pattern prefixes directly followed by literal strings, they can be used to avoid parsing other tokens as part of a pattern, like when nesting pattern literals in expression groups or in function arguments.

The following pattern types exist:

TypeExampleExplanation
e/exactexact:mod/nameMatches by comparing the identifier exactly to the given term.
c/containsc:plotMatches by checking if the given term is contained in the identifier.
r/regexregex:mod-[234]/.*Matches using the given regex.
g/globg:foo/**/barMatches using the given glob battern.
p/pathp:fooMatches using the given glob battern.