json放行

This commit is contained in:
tianmo committed 2026-09-11 14:02:48 +08:00
1 parent 99d85a9e6d
commit ba0f48c543
6 files changed
+52 -15

No files matched your search

+10
View File
@@ -35,5 +35,15 @@ try {
assert.equal(utils.discoverAssets(lateAtlas, { strictStem: true }).skeletonPath, null);
const lateSkeleton = path.join(late, 'hero.skel.bytes'); fs.writeFileSync(lateSkeleton, Buffer.from('\0' + '3.8.1\0'));
assert.equal(utils.discoverAssets(lateAtlas, { strictStem: true, refreshIndex: true }).skeletonPath, lateSkeleton);
for (const [name, json, expected] of [
['spine.json', { skeleton: { spine: '4.2.43' }, bones: [] }, 'spine'],
['empty-version.json', { skeleton: { spine: '' }, bones: [] }, 'other'],
['null-version.json', { skeleton: { spine: null }, bones: [] }, 'other'],
['fake-version.json', { skeleton: { spine: 'latest' }, bones: [] }, 'other'],
['ordinary.json', { bones: [], slots: [] }, 'other'],
]) {
const file = path.join(root, name); fs.writeFileSync(file, JSON.stringify(json));
assert.equal(utils.classifySkeletonJson(file), expected, name);
}
console.log('PASS: Eagle routing, case handling, ordinary-file exclusion, cache isolation and late-arriving skeleton');
} finally { fs.rmSync(root, { recursive: true, force: true }); }