commands/tests: name the mutation that actually reddens the arrayFilters test
The comment claimed moving `update.validate` below `scan_matching` would redden it. Ran the mutation: it does not -- the call still sits above the zero-match branch, so it still runs. What reddens it is deleting the standalone call and leaving the check to `apply`, which runs once per matched document and so never at all when nothing matched. A mutation note that has not been run is worth less than no note.
This commit was merged in pull request #7.
This commit is contained in:
@@ -5919,9 +5919,10 @@ test "arrayFilters reach the update, and are refused before the scan" {
|
||||
try testing.expectEqual(@as(i32, 9), values[1].int32);
|
||||
|
||||
// A filter no path uses is refused even when the query matches nothing at
|
||||
// all, which is what makes the check belong before the scan rather than
|
||||
// inside the per-document loop. Mutation check: move `update.validate`
|
||||
// below `scan_matching` and this answers ok.
|
||||
// all, which is what makes the check belong beside the scan rather than
|
||||
// inside `apply`. Mutation check: delete the standalone `update.validate`
|
||||
// call and this answers ok -- `apply` runs once per matched document, and
|
||||
// there are none.
|
||||
const unused = [_]bson.Value{.{ .doc = &.{
|
||||
.{ .key = "q", .value = .{ .doc = &.{.{ .key = "nomatch", .value = .{ .int32 = 1 } }} } },
|
||||
.{ .key = "u", .value = .{ .doc = &.{
|
||||
|
||||
Reference in New Issue
Block a user