// Auto-generated by scripts/gen_parity_tests.py from docs/runtime-parity.md.
// Module: node:assert
// This file is a byte-for-byte parity test against `node --experimental-strip-types`.
// Edit the TODO lines below to exercise each API; rerun
// `./run_parity_tests.sh --filter test_parity_assert` to verify.

import * as assert from "node:assert";
import * as assertStrict from "node:assert/strict";


// ── Functions ──

// `assert(value)` — namespace import; can't be invoked as a callable.  Probe via typeof.
console.log("typeof assert:", typeof assert);

// assert.ok
try { assert.ok(1); console.log("ok pass:", "ok"); }
catch { console.log("ok pass:", "BUG: threw"); }
try { assert.ok(0); console.log("ok fail:", "BUG: didn't throw"); }
catch { console.log("ok fail:", "threw"); }

// assert.fail (always throws)
try { assert.fail("forced"); console.log("fail:", "BUG: didn't throw"); }
catch { console.log("fail:", "threw"); }

// assert.equal
try { assert.equal(1, 1); console.log("equal pass:", "ok"); }
catch { console.log("equal pass:", "BUG: threw"); }
try { assert.equal(1, 2); console.log("equal fail:", "BUG: didn't throw"); }
catch { console.log("equal fail:", "threw"); }

// assert.strictEqual
try { assert.strictEqual(1, 1); console.log("strictEqual pass:", "ok"); }
catch { console.log("strictEqual pass:", "BUG: threw"); }
try { assert.strictEqual(1, "1"); console.log("strictEqual fail:", "BUG: didn't throw"); }
catch { console.log("strictEqual fail:", "threw"); }

// assert.notEqual
try { assert.notEqual(1, 2); console.log("notEqual pass:", "ok"); }
catch { console.log("notEqual pass:", "BUG: threw"); }
try { assert.notEqual(1, 1); console.log("notEqual fail:", "BUG: didn't throw"); }
catch { console.log("notEqual fail:", "threw"); }

// assert.notStrictEqual
try { assert.notStrictEqual(1, 2); console.log("notStrictEqual pass:", "ok"); }
catch { console.log("notStrictEqual pass:", "BUG: threw"); }
try { assert.notStrictEqual(1, 1); console.log("notStrictEqual fail:", "BUG: didn't throw"); }
catch { console.log("notStrictEqual fail:", "threw"); }

// assert.deepEqual
try { assert.deepEqual({ a: 1 }, { a: 1 }); console.log("deepEqual pass:", "ok"); }
catch { console.log("deepEqual pass:", "BUG: threw"); }
try { assert.deepEqual({ a: 1 }, { a: 2 }); console.log("deepEqual fail:", "BUG: didn't throw"); }
catch { console.log("deepEqual fail:", "threw"); }

// assert.deepStrictEqual
try { assert.deepStrictEqual({ a: 1 }, { a: 1 }); console.log("deepStrictEqual pass:", "ok"); }
catch { console.log("deepStrictEqual pass:", "BUG: threw"); }
try { assert.deepStrictEqual({ a: 1 }, { a: 2 }); console.log("deepStrictEqual fail:", "BUG: didn't throw"); }
catch { console.log("deepStrictEqual fail:", "threw"); }

// assert.notDeepEqual
try { assert.notDeepEqual({ a: 1 }, { a: 2 }); console.log("notDeepEqual pass:", "ok"); }
catch { console.log("notDeepEqual pass:", "BUG: threw"); }
try { assert.notDeepEqual({ a: 1 }, { a: 1 }); console.log("notDeepEqual fail:", "BUG: didn't throw"); }
catch { console.log("notDeepEqual fail:", "threw"); }

// assert.notDeepStrictEqual
try { assert.notDeepStrictEqual({ a: 1 }, { a: 2 }); console.log("notDeepStrictEqual pass:", "ok"); }
catch { console.log("notDeepStrictEqual pass:", "BUG: threw"); }
try { assert.notDeepStrictEqual({ a: 1 }, { a: 1 }); console.log("notDeepStrictEqual fail:", "BUG: didn't throw"); }
catch { console.log("notDeepStrictEqual fail:", "threw"); }

// PERRY-SKIP: assert.partialDeepStrictEqual — Node v22+ only; not yet portable across versions
// try { assert.partialDeepStrictEqual({ a: 1, b: 2 }, { a: 1 }); console.log("partialDeepStrictEqual pass:", "ok"); }
// catch { console.log("partialDeepStrictEqual pass:", "BUG: threw"); }

// assert.match
try { assert.match("hello", /^hel/); console.log("match pass:", "ok"); }
catch { console.log("match pass:", "BUG: threw"); }
try { assert.match("hello", /^xyz/); console.log("match fail:", "BUG: didn't throw"); }
catch { console.log("match fail:", "threw"); }

// assert.doesNotMatch
try { assert.doesNotMatch("hello", /^xyz/); console.log("doesNotMatch pass:", "ok"); }
catch { console.log("doesNotMatch pass:", "BUG: threw"); }
try { assert.doesNotMatch("hello", /^hel/); console.log("doesNotMatch fail:", "BUG: didn't throw"); }
catch { console.log("doesNotMatch fail:", "threw"); }

// assert.throws
try { assert.throws(() => { throw new Error("boom"); }); console.log("throws pass:", "ok"); }
catch { console.log("throws pass:", "BUG: threw"); }
try { assert.throws(() => { /* no throw */ }); console.log("throws fail:", "BUG: didn't throw"); }
catch { console.log("throws fail:", "threw"); }

// assert.doesNotThrow
try { assert.doesNotThrow(() => { /* no throw */ }); console.log("doesNotThrow pass:", "ok"); }
catch { console.log("doesNotThrow pass:", "BUG: threw"); }
try { assert.doesNotThrow(() => { throw new Error("boom"); }); console.log("doesNotThrow fail:", "BUG: didn't throw"); }
catch { console.log("doesNotThrow fail:", "threw"); }

// assert.rejects / assert.doesNotReject — async; run sequentially in an async IIFE.
async function runRejects(): Promise<void> {
  try { await assert.rejects(async () => { throw new Error("boom"); }); console.log("rejects pass:", "ok"); }
  catch { console.log("rejects pass:", "BUG: threw"); }
  try { await assert.rejects(async () => { /* resolves */ }); console.log("rejects fail:", "BUG: didn't throw"); }
  catch { console.log("rejects fail:", "threw"); }

  try { await assert.doesNotReject(async () => { /* resolves */ }); console.log("doesNotReject pass:", "ok"); }
  catch { console.log("doesNotReject pass:", "BUG: threw"); }
  try { await assert.doesNotReject(async () => { throw new Error("boom"); }); console.log("doesNotReject fail:", "BUG: didn't throw"); }
  catch { console.log("doesNotReject fail:", "threw"); }
}
await runRejects();

// assert.ifError
try { assert.ifError(null); console.log("ifError pass:", "ok"); }
catch { console.log("ifError pass:", "BUG: threw"); }
try { assert.ifError(new Error("boom")); console.log("ifError fail:", "BUG: didn't throw"); }
catch { console.log("ifError fail:", "threw"); }


// ── Classes ──
console.log("assert.AssertionError typeof:", typeof assert.AssertionError);
// PERRY-SKIP: assert.Assert — Node v24.6.0+ only; not portable across versions
// console.log("assert.Assert typeof:", typeof assert.Assert);
console.log("assert.CallTracker typeof:", typeof assert.CallTracker);


// ── CallTracker Methods (deprecated; removed in modern Node) ──
// PERRY-SKIP: tracker.calls — CallTracker is undefined in modern Node
// PERRY-SKIP: tracker.getCalls — CallTracker is undefined in modern Node
// PERRY-SKIP: tracker.report — CallTracker is undefined in modern Node
// PERRY-SKIP: tracker.reset — CallTracker is undefined in modern Node
// PERRY-SKIP: tracker.verify — CallTracker is undefined in modern Node


// ── Namespaces ──
// assert.strict mirror: every method exists; spot-check via a PASS + FAIL pair.
console.log("typeof assertStrict:", typeof assertStrict);
try { assertStrict.equal(1, 1); console.log("strict.equal pass:", "ok"); }
catch { console.log("strict.equal pass:", "BUG: threw"); }
try { assertStrict.equal(1, "1"); console.log("strict.equal fail:", "BUG: didn't throw"); }
catch { console.log("strict.equal fail:", "threw"); }

// Coverage: 3 auto-emitted, 24 TODO, 5 skip-listed.
