@hyperfixi/testing-framework 4.1.0 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +184 -1
- package/package.json +7 -7
- package/src/multilingual/command-shapes-gate.ts +76 -0
- package/src/multilingual/command-shapes.1.test.ts +9 -0
- package/src/multilingual/command-shapes.2.test.ts +9 -0
- package/src/multilingual/command-shapes.3.test.ts +9 -0
- package/src/multilingual/command-shapes.cases.json +6816 -0
- package/src/multilingual/command-shapes.cases.test.ts +122 -0
- package/src/multilingual/command-shapes.oracle.test.ts +204 -0
- package/src/multilingual/command-shapes.ts +839 -0
- package/src/multilingual/direct-path-shapes.ts +9 -2
|
@@ -376,8 +376,15 @@ export async function initDirectPathHosts(): Promise<DirectPathHosts> {
|
|
|
376
376
|
for (const steps of scriptOf(c)) parts.push(await run(host, c, code, lang, steps));
|
|
377
377
|
return parts.join(' ‖ ');
|
|
378
378
|
};
|
|
379
|
-
|
|
380
|
-
|
|
379
|
+
// Two failure channels: parse errors, and the tokenizer THROWING on a
|
|
380
|
+
// character it does not know (the text a refused translation leaves as written).
|
|
381
|
+
const rejects = (host: ScriptHost, code: string): string | undefined => {
|
|
382
|
+
try {
|
|
383
|
+
return host.parse(code)?.errors?.[0]?.message.split('\n')[0];
|
|
384
|
+
} catch (e) {
|
|
385
|
+
return (e as Error).message.split('\n')[0] ?? 'threw';
|
|
386
|
+
}
|
|
387
|
+
};
|
|
381
388
|
|
|
382
389
|
return {
|
|
383
390
|
async runCase(c) {
|