components
All repositories: gitoria
1.9 KB
// plugins/time/tests/parity.mjs — client.js (the browser half) against the native plugin.// node plugins/time/tests/parity.mjs// Runs parity.hl natively and the same calls through client.js in Node (Intl), and compares line// for line: the DST gap and fold of Europe/Vienna and America/New_York in 2026, and 1970.import { spawnSync } from 'node:child_process';import { readFileSync } from 'node:fs';import { dirname, join, resolve } from 'node:path';import { fileURLToPath } from 'node:url';const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '../../..');const BIN = process.env.HL_BIN || join(ROOT, 'native/zig-out/bin/hybriel');let failed = false;const ok = (c, m) => { if (!c) { failed = true; console.log('FAIL ' + m); } else console.log('ok ' + m); };ok(readFileSync(join(ROOT, 'plugins/time/client.js'), 'utf8') === readFileSync(join(ROOT, 'plugins/time/server.js'), 'utf8'), 'client.js is server.js, byte for byte (one implementation, two names)');const t = await import(join(ROOT, 'plugins/time/client.js'));const cases = [['Europe/Vienna', 2026, 3, 29, 2, 30], ['Europe/Vienna', 2026, 10, 25, 2, 30],['America/New_York', 2026, 3, 8, 2, 30], ['America/New_York', 2026, 11, 1, 1, 30],['Europe/Vienna', 1970, 1, 1, 0, 0], ['America/New_York', 1970, 6, 1, 12, 0], ['Europe/Vienna', 2026, 7, 1, 12, 0],];const mine = cases.map(([z, y, m, d, h, mi]) => {const ms = t.fromLocal({ year: y, month: m, day: d, hour: h, minute: mi }, z);return `${z} ${ms} ${t.offset(ms, z)} ${t.localTimestamp(ms, z)} ${t.timestamp(ms)} ${JSON.stringify(t.local(ms, z))} ${t.isZone(z)}`;});const r = spawnSync(BIN, [join(ROOT, 'plugins/time/tests/parity.hl')], { encoding: 'utf8' });const native = r.stdout.trim().split('\n');ok(r.status === 0 && native.length === mine.length, 'native run answered ' + mine.length + ' lines');mine.forEach((l, i) => ok(l === native[i], l.slice(0, 60) + (l === native[i] ? '' : '\n native: ' + native[i] + '\n client: ' + l)));process.exit(failed ? 1 : 0);
Branches
Latest commits
- 9b872cedRecord IC28 deployment and live icon verificationmre
- 46fefaa7Count the icons entry in the offline home-page checkmre
- c7e14cabRecord IC28 rerun and unchanged-main baseline comparisonmre
- 5e090ffdRecord IC28 review evidence and gate resultsmre
- adfe2c4dAdd shuffle, repeat and repeatOne shared iconsmre
- c96709c8media-player: skip = false and repeat = 'one' options (jukebox#19)mre
- bd4aa808Record VL24 deployment and live verificationmre
- e5b98ecfRun virtual-list gate before deploymentmre
- 2e9b4a8evirtual-list: into main, with centerId and scrollTop/onScroll (jukebox#20)mre
- 69954249Align all plugin sources with Hybriel day38bmre
- f740f666Re-vendor components to Hybriel set day38bmre
- 8176eb14Record CS23b deployment and live verificationmre
- 84e3ddaaRemove blank line before pagination Style closing bracemre
- a92298ddRecord exact CSS and same-date proof after specificity reviewmre
- c71a0abePreserve consumer theme specificity with nested tag rulesmre
- 64a2bc27Document CS23b style formatting proof and review statusmre
- a72b57cficons: nest Style rules in the language's formmre
- 927616e2pagination: nest Style rules in the language's formmre
- aab8ad29code-editor: nest Style rules in the language's formmre
- ba30727afile-upload: nest Style rules in the language's formmre