Merge remote-tracking branch 'origin/main' into fix/tle-catalog-matching

This commit is contained in:
VG31OP committed 2026-10-16 22:44:46 +05:30
commit b48f44f6e8
205 files changed
+20440 -1206

No files matched your search

+45
View File
@@ -457,6 +457,51 @@ test('bike share names the systems it did not search', async () => {
);
});
test('bike share over Oslo searches only the nearby Norwegian systems', async () => {
const requested = [];
const result = await composeCatalog({
tools: coreTools,
services: {
bikeshare: {
systems: GBFS_CITY_REGISTRY,
getStations: async (url) => {
requested.push(url);
return { data: { stations: [] } };
},
},
},
}).call('get_bike_share', {
area: { lat: 59.9139, lon: 10.7522, radius_km: 5 },
});
assert.deepEqual(result.data.systems.sort(), [
'Lillestrøm, Norway',
'Oslo, Norway',
]);
assert.deepEqual(result.data.systems_not_searched, []);
assert.ok(
requested.every(
(url) =>
url.startsWith('https://gbfs.urbansharing.com/oslobysykkel.no/') ||
url.startsWith('https://api.cyclocity.fr/contracts/lillestrom/'),
),
);
});
test('bike share over Stavanger searches Kolumbus Bysykkel', async () => {
const result = await composeCatalog({
tools: coreTools,
services: {
bikeshare: {
systems: GBFS_CITY_REGISTRY,
getStations: async () => ({ data: { stations: [] } }),
},
},
}).call('get_bike_share', {
area: { lat: 58.97, lon: 5.7331, radius_km: 5 },
});
assert.deepEqual(result.data.systems, ['Stavanger, Norway']);
});
test('traffic counts only roads inside a radius area and reports missing tiles', async () => {
const flow = (segments, partial = false) => ({
getStatus: async () => ({ hasKey: true }),
+18
View File
@@ -68,6 +68,24 @@ SAT B
assert.equal(tleCatalogNumber(entries[0].line2), 48274);
});
test('TLE parsing accepts matching Alpha-5 pairs and rejects mismatched Alpha-5 pairs', () => {
const text = `SAT MISMATCH
1 A0000U 98067A 24001.50000000 .00016717 00000-0 30270-3 0 9994
2 A0001 41.4697 175.8913 0005643 312.8370 141.6893 15.61287398150000
SAT ALPHA5
1 A0000U 98067A 24001.50000000 .00016717 00000-0 30270-3 0 9994
2 A0000 41.4697 175.8913 0005643 312.8370 141.6893 15.61287398150000
`;
const entries = parseTleText(text);
assert.deepEqual(
entries.map((entry) => entry.name),
['SAT ALPHA5'],
);
assert.equal(tleCatalogNumber(entries[0].line1), 100000);
assert.equal(tleCatalogNumber(entries[0].line2), 100000);
});
test('the next pass defaults to the ISS and reports times, peak and direction', async () => {
const catalog = composeCatalog({
tools: coreTools,