mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 02:44:02 +00:00
fix: judge camera catalog trimming by region, not by returned cameras
Coverage was checked only for packs among the cameras found, so an area whose cameras were all trimmed away answered zero cameras, complete. The catalog now reports where each trimmed pack's cameras are, and the tool marks an answer partial whenever its area overlaps that region.
This commit is contained in:
1 parent
7f56679a46
commit
f610de77dc
5 files changed
+94
-6
No files matched your search
@@ -129,9 +129,13 @@ test('the catalog applies the fair cap to configured packs end to end', async ()
|
||||
['env-0', 'env-1', 'env-2'],
|
||||
);
|
||||
assert.equal(sources[0].pack, 'env');
|
||||
assert.deepEqual(getSources.trimmedPacks(), [
|
||||
{ pack: 'env', available: 12, served: 9 },
|
||||
]);
|
||||
const [trimmed] = getSources.trimmedPacks();
|
||||
assert.deepEqual(
|
||||
{ ...trimmed, region: undefined },
|
||||
{ pack: 'env', available: 12, served: 9, region: undefined },
|
||||
);
|
||||
assert.equal(trimmed.region.south, 30);
|
||||
assert.ok(Math.abs(trimmed.region.north - 30.11) < 1e-9);
|
||||
} finally {
|
||||
for (const key of Object.keys(process.env)) {
|
||||
if (!(key in saved)) delete process.env[key];
|
||||
@@ -154,4 +158,5 @@ test('a pack trimmed to its nearest cameras reports how many it offered', async
|
||||
['c0', 'c1'],
|
||||
);
|
||||
assert.equal(kept.available, 5);
|
||||
assert.deepEqual(kept.region, { west: 0, south: 0, east: 0, north: 4 });
|
||||
});
|
||||
Reference in new issue
Block a user