testLiteralSpellingIsNormalized

tcmts.core.test.hash.testLiteralSpellingIsNormalized · #udd5l2mq · term

Literal spelling is normalized, values are not.

import { hashes } from "#codebase/tcmts/core/test/hash";
import assert from "node:assert/strict";

export const testLiteralSpellingIsNormalized = () => {
  const a = hashes(`const k = 1_000; const s = 'hi'; const o = { a: 1 }.a`);
  const b = hashes(`const k = 0x3e8; const s = "hi"; const o = { a: 1 }["a"]`);
  assert.deepEqual(a, b);
  assert.notEqual(hashes(`const k = 1001`).k, a.k);
}

uses