fix: match scenario 2601 monthly seed progression

This commit is contained in:
2026-08-03 18:56:23 +00:00
parent 2f17584075
commit 58b9a230a7
92 changed files with 3696 additions and 587 deletions
+18 -1
View File
@@ -1,5 +1,5 @@
import { describe, expect, it } from 'vitest';
import { getCityDistance, searchDistance } from '@sammo-ts/logic/world/distance.js';
import { getCityDistance, searchDistance, searchDistanceEntries } from '@sammo-ts/logic/world/distance.js';
import type { MapDefinition } from '@sammo-ts/logic/world/types.js';
describe('World Distance', () => {
@@ -69,5 +69,22 @@ describe('World Distance', () => {
const result = searchDistance(mockMap, 1, 10);
expect(result).not.to.have.property('8');
});
it('preserves legacy BFS visit order independently of numeric object-key ordering', () => {
const orderMap: MapDefinition = {
id: 'order-map',
name: 'Order Map',
cities: [
{ id: 1, connections: [10, 2] },
{ id: 10, connections: [1] },
{ id: 2, connections: [1] },
] as any[],
};
expect(searchDistanceEntries(orderMap, 1, 1)).toEqual([
[1, 0],
[10, 1],
[2, 1],
]);
});
});
});