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:
A.Shakhmatov
2026-08-10 20:45:03 +03:00
parent 1892cb7969
commit 1482df891b

View File

@@ -5919,9 +5919,10 @@ test "arrayFilters reach the update, and are refused before the scan" {
try testing.expectEqual(@as(i32, 9), values[1].int32); try testing.expectEqual(@as(i32, 9), values[1].int32);
// A filter no path uses is refused even when the query matches nothing at // 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 // all, which is what makes the check belong beside the scan rather than
// inside the per-document loop. Mutation check: move `update.validate` // inside `apply`. Mutation check: delete the standalone `update.validate`
// below `scan_matching` and this answers ok. // call and this answers ok -- `apply` runs once per matched document, and
// there are none.
const unused = [_]bson.Value{.{ .doc = &.{ const unused = [_]bson.Value{.{ .doc = &.{
.{ .key = "q", .value = .{ .doc = &.{.{ .key = "nomatch", .value = .{ .int32 = 1 } }} } }, .{ .key = "q", .value = .{ .doc = &.{.{ .key = "nomatch", .value = .{ .int32 = 1 } }} } },
.{ .key = "u", .value = .{ .doc = &.{ .{ .key = "u", .value = .{ .doc = &.{