- commit
- e02efa12a5ab63ea22221df64660738818d67bdc
- parent
- f82ad3dccd56d4d91c8fae52afd15801b6cb3b6b
- author
- Dami <dami.etoile@gmail.com>
| M | src/ | 10 | +++++++++- |
| M | tests/ | 20 | ++++++++++++++++++-- |
@@ -22,7 +22,15 @@ function fail(errors) {
2222 */2323 export function createCorePack(sourceLevels = builtInLevels) {2424 return {25- manifest: { id: CORE_PACK_ID, name: 'Miau Core', version: '1.0.0', engine: MOD_SCHEMA_VERSION, rules: 2 },25+ manifest: {26+ id: CORE_PACK_ID,27+ name: 'Miau Core',28+ author: 'Miau Is True',29+ version: '1.0.0',30+ engine: MOD_SCHEMA_VERSION,31+ rules: 2,32+ world: { glyph: '🐈', tagline: 'Where the rules first bend.', accent: 'you' },33+ },2634 levels: cloneData(sourceLevels),2735 palette: {},2836 vocabulary: [],@@ -14,8 +14,11 @@ const level = (title, id) => ({ id, title, width: 2, height: 1, objects: [
1414 1515 test('starts with stable core pack and preserves additive import order', () => {1616 const catalog = createCatalog({ coreLevels: [level('Core', 'intro')] });17- assert.equal(catalog.getPack('core').manifest.rules, 2);18- assert.deepEqual(catalog.getPacks()[0].world, { glyph: null, tagline: null, accent: null });17+ const core = catalog.getPack('core');18+ assert.equal(core.manifest.rules, 2);19+ assert.equal(core.manifest.author, 'Miau Is True');20+ assert.deepEqual(core.manifest.world, { glyph: '🐈', tagline: 'Where the rules first bend.', accent: 'you' });21+ assert.deepEqual(catalog.getPacks()[0].world, core.manifest.world);1922 assert.deepEqual(catalog.getPacks().map(pack => pack.id), ['core']);2023 catalog.importMod(pack('alpha', 'Alpha', [level('A one', 'start'), level('A two', 'next')]));2124 catalog.importMod(pack('beta', 'Beta', [level('B one', 'start')]));@@ -25,6 +28,19 @@ test('starts with stable core pack and preserves additive import order', () => {
2528 assert.equal(catalog.getLevel('alpha:start').origin, 'local');2629 });2730 31+test('core world identity remains effective through catalog normalization', () => {32+ const catalog = createCatalog({ coreLevels: [level('Core', 'intro')] });33+ const [core] = catalog.getPacks();34+ assert.equal(core.id, 'core');35+ assert.equal(core.manifest.author, 'Miau Is True');36+ assert.deepEqual(core.world, {37+ glyph: '🐈',38+ tagline: 'Where the rules first bend.',39+ accent: 'you',40+ });41+ assert.deepEqual(core.worldWarnings, []);42+});43+2844 test('invalid world identity falls back without losing authored pack data', () => {2945 const catalog = createCatalog({ coreLevels: [level('Core', 'intro')] });3046 const source = pack('world-bad', 'World Bad', [level('Proof', 'intro')]);