bun test v1.4.2 (744846f84)

test/game.test.mjs:
(pass) left/right input rotates exactly one side; paused/title/ended input cannot rotate [3.56ms]
(pass) three connected blocks score 9 across wraparound; two and diagonals do not clear [1.91ms]
(pass) overflow boundary excludes blocks already marked deleted [1.17ms]
(pass) highscores persist numeric descending top three [1.40ms]
(pass) pause is immediate, freezes input, persists and resumes without old frame delta [0.80ms]
(pass) data-only round trip restores classes, asymmetric distances, combo and wave pattern at a new scale [3.59ms]
(pass) malicious method strings and prototype keys never execute or replace constructed methods [1.37ms]
(pass) invalid saves fail closed at type, size, lane, pattern and numeric boundaries [3.43ms]
(pass) legacy continuation resets without evaluating it; valid numeric highscores migrate once without clobbering generic keys [0.72ms]

 9 pass
 0 fail
 112 expect() calls
Ran 9 tests across 1 file. [26.00ms]
=== MUTANT=score (expected exit 1) ===
bun test v1.4.2 (744846f84)

test/game.test.mjs:
(pass) left/right input rotates exactly one side; paused/title/ended input cannot rotate [2.78ms]
61 |   c.MainHex.blocks[1] = [block('blue'), block('red')];
62 |   c.consolidateBlocks(c.MainHex, 0, 0);
63 |   expect(c.score).toBe(0);
64 |   c.MainHex.blocks[5].push(block('red'));
65 |   c.consolidateBlocks(c.MainHex, 0, 0);
66 |   expect(c.score).toBe(9);
                       ^
error: expect(received).toBe(expected)

Expected: 9
Received: 3

      at <anonymous> (/home/user/workspace/repo/examples/hextris/test/game.test.mjs:66:19)
(fail) three connected blocks score 9 across wraparound; two and diagonals do not clear [1.12ms]
(pass) overflow boundary excludes blocks already marked deleted [0.66ms]
(pass) highscores persist numeric descending top three [0.96ms]
(pass) pause is immediate, freezes input, persists and resumes without old frame delta [0.56ms]
(pass) data-only round trip restores classes, asymmetric distances, combo and wave pattern at a new scale [2.67ms]
(pass) malicious method strings and prototype keys never execute or replace constructed methods [1.29ms]
(pass) invalid saves fail closed at type, size, lane, pattern and numeric boundaries [3.01ms]
(pass) legacy continuation resets without evaluating it; valid numeric highscores migrate once without clobbering generic keys [0.71ms]

 8 pass
 1 fail
 110 expect() calls
Ran 9 tests across 1 file. [23.00ms]
exit=1
=== MUTANT=input (expected exit 1) ===
bun test v1.4.2 (744846f84)

test/game.test.mjs:
46 |   handlers.pointerdown({ isPrimary: false, button: 0, clientX: 80 });
47 |   expect(c.MainHex.position).toBe(0);
48 |   for (const state of [-1, 0, 2]) {
49 |     c.gameState = state;
50 |     c.handleClickTap(80);
51 |     expect(c.MainHex.position).toBe(0);
                                    ^
error: expect(received).toBe(expected)

Expected: 0
Received: 1

      at <anonymous> (/home/user/workspace/repo/examples/hextris/test/game.test.mjs:51:32)
(fail) left/right input rotates exactly one side; paused/title/ended input cannot rotate [3.47ms]
(pass) three connected blocks score 9 across wraparound; two and diagonals do not clear [1.04ms]
(pass) overflow boundary excludes blocks already marked deleted [0.67ms]
(pass) highscores persist numeric descending top three [0.93ms]
(pass) pause is immediate, freezes input, persists and resumes without old frame delta [0.58ms]
(pass) data-only round trip restores classes, asymmetric distances, combo and wave pattern at a new scale [2.35ms]
(pass) malicious method strings and prototype keys never execute or replace constructed methods [1.33ms]
(pass) invalid saves fail closed at type, size, lane, pattern and numeric boundaries [2.86ms]
(pass) legacy continuation resets without evaluating it; valid numeric highscores migrate once without clobbering generic keys [0.77ms]

 8 pass
 1 fail
 111 expect() calls
Ran 9 tests across 1 file. [20.00ms]
exit=1
=== MUTANT=overflow (expected exit 1) ===
bun test v1.4.2 (744846f84)

test/game.test.mjs:
(pass) left/right input rotates exactly one side; paused/title/ended input cannot rotate [2.67ms]
(pass) three connected blocks score 9 across wraparound; two and diagonals do not clear [0.92ms]
69 | });
70 | 
71 | test('overflow boundary excludes blocks already marked deleted', () => {
72 |   const { c } = game();
73 |   c.MainHex.blocks[2] = Array.from({ length: 7 }, () => ({ deleted: 0 }));
74 |   expect(c.isInfringing(c.MainHex)).toBe(false);
                                         ^
error: expect(received).toBe(expected)

Expected: false
Received: true

      at <anonymous> (/home/user/workspace/repo/examples/hextris/test/game.test.mjs:74:37)
(fail) overflow boundary excludes blocks already marked deleted [0.80ms]
(pass) highscores persist numeric descending top three [0.94ms]
(pass) pause is immediate, freezes input, persists and resumes without old frame delta [0.56ms]
(pass) data-only round trip restores classes, asymmetric distances, combo and wave pattern at a new scale [2.34ms]
(pass) malicious method strings and prototype keys never execute or replace constructed methods [1.29ms]
(pass) invalid saves fail closed at type, size, lane, pattern and numeric boundaries [3.11ms]
(pass) legacy continuation resets without evaluating it; valid numeric highscores migrate once without clobbering generic keys [0.68ms]

 8 pass
 1 fail
 110 expect() calls
Ran 9 tests across 1 file. [19.00ms]
exit=1
=== MUTANT=save-eval (expected exit 1) ===
bun test v1.4.2 (744846f84)

test/game.test.mjs:
(pass) left/right input rotates exactly one side; paused/title/ended input cannot rotate [3.20ms]
(pass) three connected blocks score 9 across wraparound; two and diagonals do not clear [0.92ms]
(pass) overflow boundary excludes blocks already marked deleted [0.64ms]
(pass) highscores persist numeric descending top three [0.89ms]
(pass) pause is immediate, freezes input, persists and resumes without old frame delta [0.61ms]
(pass) data-only round trip restores classes, asymmetric distances, combo and wave pattern at a new scale [2.66ms]
159 |   data.blocks[0].draw = payload;
160 |   data.hex.blocks[2][0].getIndex = payload;
161 |   Object.defineProperty(data.hex, '__proto__', { value: { compromised: true }, enumerable: true });
162 |   storage.set(c.SAVE_KEY, JSON.stringify(data));
163 |   const parsed = c.readSaveState();
164 |   expect(vm.runInContext('globalThis.compromised', c)).toBeUndefined();
                                                             ^
error: expect(received).toBeUndefined()

Received: true

      at <anonymous> (/home/user/workspace/repo/examples/hextris/test/game.test.mjs:164:56)
(fail) malicious method strings and prototype keys never execute or replace constructed methods [1.34ms]
(pass) invalid saves fail closed at type, size, lane, pattern and numeric boundaries [3.84ms]
(pass) legacy continuation resets without evaluating it; valid numeric highscores migrate once without clobbering generic keys [0.72ms]

 8 pass
 1 fail
 105 expect() calls
Ran 9 tests across 1 file. [23.00ms]
exit=1
=== MUTANT=save-bound (expected exit 1) ===
bun test v1.4.2 (744846f84)

test/game.test.mjs:
(pass) left/right input rotates exactly one side; paused/title/ended input cannot rotate [5.88ms]
(pass) three connected blocks score 9 across wraparound; two and diagonals do not clear [2.95ms]
(pass) overflow boundary excludes blocks already marked deleted [2.37ms]
(pass) highscores persist numeric descending top three [1.76ms]
(pass) pause is immediate, freezes input, persists and resumes without old frame delta [0.96ms]
(pass) data-only round trip restores classes, asymmetric distances, combo and wave pattern at a new scale [4.29ms]
(pass) malicious method strings and prototype keys never execute or replace constructed methods [2.18ms]
184 |     d => d.blocks = Array(65).fill(d.blocks[0]), d => d.hex.blocks[2] = Array(33).fill(d.hex.blocks[2][0]),
185 |     d => d.version = 2];
186 |   for (const edit of edits) {
187 |     const data = structuredClone(original); edit(data);
188 |     storage.set(c.SAVE_KEY, JSON.stringify(data));
189 |     expect(c.readSaveState()).toBeNull();
                                    ^
error: expect(received).toBeNull()

Received: {
  version: 1,
  hex: {
    position: 6,
    ct: 431.25,
    angle: 30,
    targetAngle: 30,
    angularVelocity: 0,
    lastCombo: 400,
    comboMultiplier: 3,
    lastColorScored: "red",
    blocks: [
      [], [], [
        {
          fallingLane: 3,
          attachedLane: 2,
          iter: 2.75,
          distFromHex: 120.00000000000001,
          angle: -120,
          targetAngle: -120,
          angularVelocity: 0,
          settled: 1,
          checked: 0,
          deleted: 0,
          removed: 0,
          initializing: 0,
          tint: 0,
          opacity: 1,
          ict: 431.25,
          initLen: 60,
          color: "red",
          toString: [Function: toString],
          toLocaleString: [Function: toLocaleString],
          valueOf: [Function: valueOf],
          hasOwnProperty: [Function: hasOwnProperty],
          propertyIsEnumerable: [Function: propertyIsEnumerable],
          isPrototypeOf: [Function: isPrototypeOf],
          __defineGetter__: [Function: __defineGetter__],
          __defineSetter__: [Function: __defineSetter__],
          __lookupGetter__: [Function: __lookupGetter__],
          __lookupSetter__: [Function: __lookupSetter__],
        }
      ], [], [], []
    ],
    toString: [Function: toString],
    toLocaleString: [Function: toLocaleString],
    valueOf: [Function: valueOf],
    hasOwnProperty: [Function: hasOwnProperty],
    propertyIsEnumerable: [Function: propertyIsEnumerable],
    isPrototypeOf: [Function: isPrototypeOf],
    __defineGetter__: [Function: __defineGetter__],
    __defineSetter__: [Function: __defineSetter__],
    __lookupGetter__: [Function: __lookupGetter__],
    __lookupSetter__: [Function: __lookupSetter__],
  },
  blocks: [
    {
      fallingLane: 4,
      attachedLane: 0,
      iter: 1.25,
      distFromHex: 190,
      angle: -180,
      targetAngle: -180,
      angularVelocity: 0,
      settled: 0,
      checked: 0,
      deleted: 0,
      removed: 0,
      initializing: 1,
      tint: 0,
      opacity: 1,
      ict: 431.25,
      initLen: 60,
      color: "blue",
      toString: [Function: toString],
      toLocaleString: [Function: toLocaleString],
      valueOf: [Function: valueOf],
      hasOwnProperty: [Function: hasOwnProperty],
      propertyIsEnumerable: [Function: propertyIsEnumerable],
      isPrototypeOf: [Function: isPrototypeOf],
      __defineGetter__: [Function: __defineGetter__],
      __defineSetter__: [Function: __defineSetter__],
      __lookupGetter__: [Function: __lookupGetter__],
      __lookupSetter__: [Function: __lookupSetter__],
    }
  ],
  wavegen: {
    lastGen: 5678,
    last: 0,
    nextGen: 1650,
    start: 0,
    ct: 4.5,
    difficulty: 12.5,
    dt: 6000,
    pattern: "crosswiseGeneration",
    toString: [Function: toString],
    toLocaleString: [Function: toLocaleString],
    valueOf: [Function: valueOf],
    hasOwnProperty: [Function: hasOwnProperty],
    propertyIsEnumerable: [Function: propertyIsEnumerable],
    isPrototypeOf: [Function: isPrototypeOf],
    __defineGetter__: [Function: __defineGetter__],
    __defineSetter__: [Function: __defineSetter__],
    __lookupGetter__: [Function: __lookupGetter__],
    __lookupSetter__: [Function: __lookupSetter__],
  },
  score: 137,
  comboTime: 279,
  toString: [Function: toString],
  toLocaleString: [Function: toLocaleString],
  valueOf: [Function: valueOf],
  hasOwnProperty: [Function: hasOwnProperty],
  propertyIsEnumerable: [Function: propertyIsEnumerable],
  isPrototypeOf: [Function: isPrototypeOf],
  __defineGetter__: [Function: __defineGetter__],
  __defineSetter__: [Function: __defineSetter__],
  __lookupGetter__: [Function: __lookupGetter__],
  __lookupSetter__: [Function: __lookupSetter__],
}

      at <anonymous> (/home/user/workspace/repo/examples/hextris/test/game.test.mjs:189:31)
(fail) invalid saves fail closed at type, size, lane, pattern and numeric boundaries [2.54ms]
(pass) legacy continuation resets without evaluating it; valid numeric highscores migrate once without clobbering generic keys [1.13ms]

 8 pass
 1 fail
 56 expect() calls
Ran 9 tests across 1 file. [38.00ms]
exit=1
=== MUTANT=save-scale (expected exit 1) ===
bun test v1.4.2 (744846f84)

test/game.test.mjs:
(pass) left/right input rotates exactly one side; paused/title/ended input cannot rotate [2.55ms]
(pass) three connected blocks score 9 across wraparound; two and diagonals do not clear [0.88ms]
(pass) overflow boundary excludes blocks already marked deleted [0.62ms]
(pass) highscores persist numeric descending top three [0.89ms]
(pass) pause is immediate, freezes input, persists and resumes without old frame delta [0.58ms]
137 |   c.settings.hexWidth = 43.5;
138 |   c.restoreSaveState(c.readSaveState());
139 |   expect(c.MainHex instanceof c.Hex).toBe(true);
140 |   expect(c.MainHex.blocks[2][0] instanceof c.Block).toBe(true);
141 |   expect(c.MainHex.blocks[2][0].getIndex()).toBe(0);
142 |   expect(c.MainHex.blocks[2][0].distFromHex).toBeCloseTo(60);
                                                   ^
error: expect(received).toBeCloseTo(expected, precision)

Expected: 60
Received: 120.00000000000001

Expected precision: 2
Expected difference: < 0.005
Received difference: 60.000000000000014

      at <anonymous> (/home/user/workspace/repo/examples/hextris/test/game.test.mjs:142:46)
(fail) data-only round trip restores classes, asymmetric distances, combo and wave pattern at a new scale [2.27ms]
(pass) malicious method strings and prototype keys never execute or replace constructed methods [1.37ms]
(pass) invalid saves fail closed at type, size, lane, pattern and numeric boundaries [2.82ms]
(pass) legacy continuation resets without evaluating it; valid numeric highscores migrate once without clobbering generic keys [0.74ms]

 8 pass
 1 fail
 106 expect() calls
Ran 9 tests across 1 file. [18.00ms]
exit=1
=== MUTANT=save-pattern (expected exit 1) ===
bun test v1.4.2 (744846f84)

test/game.test.mjs:
(pass) left/right input rotates exactly one side; paused/title/ended input cannot rotate [4.40ms]
(pass) three connected blocks score 9 across wraparound; two and diagonals do not clear [1.93ms]
(pass) overflow boundary excludes blocks already marked deleted [1.56ms]
(pass) highscores persist numeric descending top three [2.59ms]
(pass) pause is immediate, freezes input, persists and resumes without old frame delta [1.78ms]
142 |   expect(c.MainHex.blocks[2][0].distFromHex).toBeCloseTo(60);
143 |   expect(c.blocks[0].distFromHex).toBeCloseTo(95);
144 |   expect([c.score, c.MainHex.ct, c.MainHex.position, c.MainHex.lastCombo, c.MainHex.comboMultiplier, c.settings.comboTime])
145 |     .toEqual([137, 431.25, 5, 400, 3, 279]);
146 |   expect([c.waveone.ct, c.waveone.difficulty, c.waveone.lastGen, c.waveone.dt, c.waveone.nextGen]).toEqual([4.5, 12.5, 5678, 6000, 1650]);
147 |   expect(c.waveone.currentFunction).toBe(c.waveone.crosswiseGeneration);
                                          ^
error: expect(received).toBe(expected)

Expected: [Function]
Received: [Function]

      at <anonymous> (/home/user/workspace/repo/examples/hextris/test/game.test.mjs:147:37)
(fail) data-only round trip restores classes, asymmetric distances, combo and wave pattern at a new scale [4.65ms]
165 |   c.restoreSaveState(parsed);
166 |   c.handleClickTap(20);
167 |   expect(c.MainHex.position).toBe(0);
168 |   expect(c.MainHex.blocks[2][0].getIndex()).toBe(0);
169 |   expect(typeof c.blocks[0].draw).toBe('function');
170 |   expect(c.waveone.currentFunction).toBe(c.waveone.crosswiseGeneration);
                                          ^
error: expect(received).toBe(expected)

Expected: [Function]
Received: [Function]

      at <anonymous> (/home/user/workspace/repo/examples/hextris/test/game.test.mjs:170:37)
(fail) malicious method strings and prototype keys never execute or replace constructed methods [2.83ms]
(pass) invalid saves fail closed at type, size, lane, pattern and numeric boundaries [6.30ms]
(pass) legacy continuation resets without evaluating it; valid numeric highscores migrate once without clobbering generic keys [1.46ms]

 7 pass
 2 fail
 107 expect() calls
Ran 9 tests across 1 file. [37.00ms]
exit=1
=== MUTANT=save-namespace (expected exit 1) ===
bun test v1.4.2 (744846f84)

test/game.test.mjs:
(pass) left/right input rotates exactly one side; paused/title/ended input cannot rotate [4.69ms]
(pass) three connected blocks score 9 across wraparound; two and diagonals do not clear [1.81ms]
(pass) overflow boundary excludes blocks already marked deleted [1.28ms]
80 | 
81 | test('highscores persist numeric descending top three', () => {
82 |   const { c, storage } = game();
83 |   c.highscores = [9, 121, 43, 1000, 2];
84 |   c.writeHighScores();
85 |   expect(JSON.parse(storage.get('origingame.hextris.highscores.v1'))).toEqual([1000, 121, 43]);
                   ^
SyntaxError: JSON Parse error: Unexpected identifier "undefined"
      at <anonymous> (/home/user/workspace/repo/examples/hextris/test/game.test.mjs:85:15)
(fail) highscores persist numeric descending top three [1.70ms]
(pass) pause is immediate, freezes input, persists and resumes without old frame delta [1.07ms]
(pass) data-only round trip restores classes, asymmetric distances, combo and wave pattern at a new scale [4.28ms]
(pass) malicious method strings and prototype keys never execute or replace constructed methods [2.01ms]
(pass) invalid saves fail closed at type, size, lane, pattern and numeric boundaries [5.49ms]
216 |   // Bun's VM proxy caches a previously read primitive; inspect the live realm.
217 |   expect(vm.runInContext('saveWasReset', c)).toBe(false);
218 |   expect(c.readSaveState()).toBeNull();
219 |   expect(vm.runInContext('saveWasReset', c)).toBe(false);
220 |   expect(storage.get('saveState')).toBe(legacy);
221 |   expect(storage.get('highscores')).toBe('[9,"999",121,-1,43,2.5,null,{},1e100]');
                                          ^
error: expect(received).toBe(expected)

Expected: "[9,"999",121,-1,43,2.5,null,{},1e100]"
Received: "[121,43,9]"

      at <anonymous> (/home/user/workspace/repo/examples/hextris/test/game.test.mjs:221:37)
(fail) legacy continuation resets without evaluating it; valid numeric highscores migrate once without clobbering generic keys [1.62ms]

 7 pass
 2 fail
 109 expect() calls
Ran 9 tests across 1 file. [34.00ms]
exit=1
