Skip to content

armgit / 67.js

Public Imported from GitHub
0

3D engine that AI agents drive

Read the user-pass doc example with either line ending

Nguyen Xuan Ane80dcfd384e6
diff --git a/tests/shader-snippet-validator.test.js b/tests/shader-snippet-validator.test.js
index 3d4bea18..92455e71 100644
--- a/tests/shader-snippet-validator.test.js
+++ b/tests/shader-snippet-validator.test.js
@@ -124,7 +124,8 @@ test('passes: count, names, fields, scale and the entry function', () => {
});
test('the documented example passes the validator and builds a scene', async () => {
- const documentation = readFileSync(new URL('../docs/user-passes.md', import.meta.url), 'utf8');
+ // A Windows checkout may turn the doc's line endings into CRLF.
+ const documentation = readFileSync(new URL('../docs/user-passes.md', import.meta.url), 'utf8').replaceAll('\r\n', '\n');
const recipeText = documentation.match(/```json\n(\{"postPasses".*)\n```/)[1];
const { postPasses } = JSON.parse(recipeText);
const [pass] = normalizeUserPasses(postPasses);