Some of our special tests can only be run once per `go test` invocation. That is, using the test -count flag will cause a guaranteed failure since we depend on a global being initialized only once as part of that test. This adds a per-test config option so that a user can specify to never run a particular test more than once. This lets us continue to use the -count flag with the test suite, without it causing some tests to fail.
24 lines
450 B
Plaintext
24 lines
450 B
Plaintext
-- CONFIG --
|
|
{
|
|
"maximum-count": 1
|
|
}
|
|
-- main.mcl --
|
|
import "test"
|
|
|
|
$double = func($x) {
|
|
$x + $x
|
|
}
|
|
|
|
# one_instance_g should only produce one value, and will error if initialized twice
|
|
test "test1" {
|
|
anotherstr => $double(test.one_instance_g()),
|
|
}
|
|
|
|
# one_instance_h should only produce one value, and will error if initialized twice
|
|
test "test2" {
|
|
anotherstr => $double(test.one_instance_h()),
|
|
}
|
|
-- OUTPUT --
|
|
Vertex: test[test1]
|
|
Vertex: test[test2]
|