22 lines
946 B
Go
22 lines
946 B
Go
// Package mutantfixture is the subject the mutation harness is pinned against: a tiny module with
|
|
// one rule, two tests that watch different halves of it, and one test that is red on purpose.
|
|
//
|
|
// It exists because the harness's own verdicts cannot be checked against the zone's code — there a
|
|
// planting's outcome is what is being measured, so a wrong verdict looks like a finding. Here the
|
|
// right answer for every record is known in advance, which is what makes the harness measurable.
|
|
package mutantfixture
|
|
|
|
// Allowed reports whether a value is inside the band. Two facts, watched by two different tests, so
|
|
// a planting can break one of them and leave the other green.
|
|
func Allowed(n int) bool {
|
|
if n < 0 {
|
|
return false
|
|
}
|
|
return n <= 10
|
|
}
|
|
|
|
// Label is the band's name, and nothing asserts it: a planting here is what a SURVIVING mutation
|
|
// looks like when the fixture's answer is known.
|
|
func Label() string {
|
|
return "band"
|
|
}
|