# made by 100x verify mutate
# command: X100_FAST=1 node --test --test-name-pattern="it plants every edit it can make|a defect that never ends is stopped|a list of edits for any file runs each one|a run that is interrupted|a measure that cannot be made" test/mutate.test.mjs
# defect: lib/mutate.mjs:523 compare: === becomes !==
# exit: 1
# digest: 9bb8bf18069b4176
FAIL  mutate-measures. a planted defect made the check fail at lib/mutate.mjs:523: compare: === becomes !== (exit 1)
✖ it plants every edit it can make, counts what the check noticed, lists what it did not, and leaves the project as it was (29544.500959ms)
✖ a defect that never ends is stopped with everything it started, and no file or process is left behind (12514.446833ms)
✔ a run that is interrupted stops what it started and leaves no copy and no process behind, on either signal (10282.709167ms)
✔ a measure that cannot be made says why in a word the callers read: the check is red, or there is no code to edit (4271.414917ms)
✖ a list of edits for any file runs each one: a changed rule is killed, a harmless one survives, and one that breaks the syntax is not run (6650.490791ms)
ℹ tests 5
ℹ suites 0
ℹ pass 2
ℹ fail 3
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 66903.931833

✖ failing tests:

test at test/mutate.test.mjs:280:1
✖ it plants every edit it can make, counts what the check noticed, lists what it did not, and leaves the project as it was (29544.500959ms)
  AssertionError [ERR_ASSERTION]: The input did not match the regular expression /^killed {4}21\. The check failed on a planted defect\.$/m. Input:
  
  '$ node verify/pay.check.mjs\n' +
    'mutate pay-rules\n' +
    'files lib/pay.mjs\n' +
    'planted 25 edits, every one this command can make here.\n' +
    'killed    4. The check failed on a planted defect.\n' +
    'survived  21. The check passed with the defect in place.\n' +
    'invalid   25. The edit left code that does not parse, so it was not run.\n' +
    'score     4 of 25 caught of the defects that ran, 16%.\n' +
    '\n' +
    'survivors. Each is a defect the check did not notice.\n' +
    "  lib/pay.mjs:2  condition: state.status !== 'open' becomes false\n" +
    "  lib/pay.mjs:2  throw: delete throw new Error('the order is not open');\n" +
    "  lib/pay.mjs:2  throw: throw new Error('the order is not open'); becomes return state;\n" +
    '  lib/pay.mjs:3  operand: delete !Number.isInteger(amount) ||\n' +
    '\n' +
    'next. Read each survivor: is it a gap in the check, or an edit that changes nothing? For a gap, add a case that fails with that defect in, then run this again. --min <percent> makes a lower score exit 1.\n' +
    '\n' +
    'verify/red/pay-rules.txt now holds the first defect caught, made by this command for this command, with a digest of its output.\n' +
    'Full report: verify/mutation/pay-rules.txt\n' +
    '\n' +
    'What this cannot show. A survivor is a defect the check did not notice, or an edit that changes nothing a person could see (an equivalent defect). Only a reader can tell which.\n' +
    'A count is about the defects planted and says nothing about the ones that were not.\n' +
    'Edits are single and come from a fixed list, so a defect that needs two is not measured.\n' +
    'The automatic edits read JavaScript and TypeScript. --edits takes a list of edits for any other language.\n'
  
      at TestContext.<anonymous> (file://<project>/test/mutate.test.mjs:294:10)
      at Test.runInAsyncScope (node:async_hooks:226:14)
      at Test.run (node:internal/test_runner/test:1402:25)
      at Test.start (node:internal/test_runner/test:1262:17)
      at startSubtestAfterBootstrap (node:internal/test_runner/harness:387:17) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: "$ node verify/pay.check.mjs\nmutate pay-rules\nfiles lib/pay.mjs\nplanted 25 edits, every one this command can make here.\nkilled    4. The check failed on a planted defect.\nsurvived  21. The check passed with the defect in place.\ninvalid   25. The edit left code that does not parse, so it was not run.\nscore     4 of 25 caught of the defects that ran, 16%.\n\nsurvivors. Each is a defect the check did not notice.\n  lib/pay.mjs:2  condition: state.status !== 'open' becomes false\n  lib/pay.mjs:2  throw: delete throw new Error('the order is not open');\n  lib/pay.mjs:2  throw: throw new Error('the order is not open'); becomes return state;\n  lib/pay.mjs:3  operand: delete !Number.isInteger(amount) ||\n\nnext. Read each survivor: is it a gap in the check, or an edit that changes nothing? For a gap, add a case that fails with that defect in, then run this again. --min <percent> makes a lower score exit 1.\n\nverify/red/pay-rules.txt now holds the first defect caught, made by this command for this command, with a digest of its output.\nFull report: verify/mutation/pay-rules.txt\n\nWhat this cannot show. A survivor is a defect the check did not notice, or an edit that changes nothing a person could see (an equivalent defect). Only a reader can tell which.\nA count is about the defects planted and says nothing about the ones that were not.\nEdits are single and come from a fixed list, so a defect that needs two is not measured.\nThe automatic edits read JavaScript and TypeScript. --edits takes a list of edits for any other language.\n",
    expected: /^killed {4}21\. The check failed on a planted defect\.$/m,
    operator: 'match',
    diff: 'simple'
  }

test at test/mutate.test.mjs:529:1
✖ a defect that never ends is stopped with everything it started, and no file or process is left behind (12514.446833ms)
  AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
  + actual - expected
  
    [
      2,
  +   0,
      2,
  +   2,
  -   0,
  -   0,
      1
    ]
  
      at TestContext.<anonymous> (file://<project>/test/mutate.test.mjs:561:10)
      at Test.runInAsyncScope (node:async_hooks:226:14)
      at Test.run (node:internal/test_runner/test:1402:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:974:18) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: [ 2, 0, 2, 2, 1 ],
    expected: [ 2, 2, 0, 0, 1 ],
    operator: 'deepStrictEqual',
    diff: 'simple'
  }

test at test/mutate.test.mjs:643:1
✖ a list of edits for any file runs each one: a changed rule is killed, a harmless one survives, and one that breaks the syntax is not run (6650.490791ms)
  AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
  + actual - expected
  
    [
      3,
  +   2,
  +   2,
  +   2
  -   1,
  -   1,
  -   1
    ]
  
      at TestContext.<anonymous> (file://<project>/test/mutate.test.mjs:662:10)
      at Test.runInAsyncScope (node:async_hooks:226:14)
      at Test.run (node:internal/test_runner/test:1402:25)
      at Test.processPendingSubtests (node:internal/test_runner/test:974:18)
      at Test.postRun (node:internal/test_runner/test:1542:19)
      at Test.run (node:internal/test_runner/test:1467:12)
      at async Test.processPendingSubtests (node:internal/test_runner/test:974:7) {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: [ 3, 2, 2, 2 ],
    expected: [ 3, 1, 1, 1 ],
    operator: 'deepStrictEqual',
    diff: 'simple'
  }
