@afokapu/atdd-bun 0.10.19 → 0.10.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -287,8 +287,13 @@ export function tokenCovered(token, text) {
|
|
|
287
287
|
return new RegExp("(?<![\\w-])" + esc + "(?![\\w-])").test(text);
|
|
288
288
|
}
|
|
289
289
|
|
|
290
|
-
|
|
291
|
-
|
|
290
|
+
// A train id is unique, so naming it covers the route. A route id is not: `refuse` or `record` can be routes of several
|
|
291
|
+
// interlockings, and a test of one must not cover the others (FWS #liu3vKZYAPXD). A route id counts only in a test that
|
|
292
|
+
// also names its interlocking, by id or slug.
|
|
293
|
+
export function isRouteCovered(route, e2eTexts, interlockingId = null) {
|
|
294
|
+
const slug = interlockingId ? interlockingId.replace(/^interlocking:/, "") : null;
|
|
295
|
+
const ownInterlocking = (t) => !interlockingId || tokenCovered(interlockingId, t) || tokenCovered(slug, t);
|
|
296
|
+
return e2eTexts.some((t) => tokenCovered(route.trainId, t) || (tokenCovered(route.routeId, t) && ownInterlocking(t)));
|
|
292
297
|
}
|
|
293
298
|
|
|
294
299
|
export function interlockingTokenSet(records) {
|
|
@@ -34,7 +34,7 @@ for (const scanRoot of roots) {
|
|
|
34
34
|
|
|
35
35
|
for (const { file, rec } of records) {
|
|
36
36
|
for (const route of rec.routes) {
|
|
37
|
-
if (isRouteCovered(route, e2eTexts)) continue;
|
|
37
|
+
if (isRouteCovered(route, e2eTexts, rec.interlockingId)) continue;
|
|
38
38
|
if (unbuiltWagons(croot, route.trainId).length) continue; // pending: a wagon on its train has no source yet
|
|
39
39
|
const cat =
|
|
40
40
|
route.category !== null
|
package/integrity.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.10.
|
|
2
|
+
"version": "0.10.20",
|
|
3
3
|
"files": {
|
|
4
4
|
"HOOK_AUDIT.md": "5329d840db37671b1918f688ead26865473b87db73dbc75f7c8b2a8bbe8d6d43",
|
|
5
5
|
"PLANNER_PORT.md": "fb5935bac8b7ac18994de21e43ace3a5ef8cd55f85b0e3349fca261280054f11",
|
|
@@ -379,11 +379,11 @@
|
|
|
379
379
|
"detectors/bun_interlocking_binding/fixtures/dirty_transcribed_runtime/server.ts": "d5bc34c5b1b2b0a511e0c4604ce6f9c77491dca9aee994be720540f3052babc1",
|
|
380
380
|
"detectors/bun_interlocking_binding/fixtures/dirty_transcribed_runtime/src/trains/interlocking.ts": "9bcfdb4ecff6efd1f658b9fd587342615179924e25468c75daa07c2626d4d8ab",
|
|
381
381
|
"detectors/bun_interlocking_binding/fixtures/dirty_transcribed_runtime/src/trains/runner.ts": "0e4b885e50f12cc2a8c8f6740bf83e7b2e7137a28e1e143586e9a8550ea5bd45",
|
|
382
|
-
"detectors/bun_interlocking_coverage/_shared/interlocking.mjs": "
|
|
382
|
+
"detectors/bun_interlocking_coverage/_shared/interlocking.mjs": "4946e582f1ddee7346a6d546bd8309f622ffeb383f9f8ac1a02de9d20a72723d",
|
|
383
383
|
"detectors/bun_interlocking_coverage/atdd.implementation.yaml": "f160517a8138ba3ca05e3d130e6fbfb796e643376f25743fdef4fc210196525b",
|
|
384
384
|
"detectors/bun_interlocking_coverage/checks/_map.json": "0a218ea319cc6258af7bd721c2154cb9561fe67e80d80ef32d08fc77bc9403c3",
|
|
385
385
|
"detectors/bun_interlocking_coverage/checks/interlocking_production_runner.mjs": "136eb0955052f2485740adfb888f5ba6f1414dcdb53d505034b8db40420a611a",
|
|
386
|
-
"detectors/bun_interlocking_coverage/checks/interlocking_route_coverage.mjs": "
|
|
386
|
+
"detectors/bun_interlocking_coverage/checks/interlocking_route_coverage.mjs": "2d73c401adf77b3147e11271653c528d02dfc50f4eebde8be35795707023fb6d",
|
|
387
387
|
"detectors/bun_interlocking_coverage/checks/interlocking_smoke_coverage.mjs": "ea4b0155c4f151a36979d850aa2482901b37eacc0fe01cecc0a736089a3e15ce",
|
|
388
388
|
"detectors/bun_interlocking_coverage/checks/interlocking_trace_binds.mjs": "61dcb8a8d04e9764aab7920f346bd3684fc98e2c294aa5c58eefec555145a1d0",
|
|
389
389
|
"detectors/bun_interlocking_coverage/checks/interlocking_train_sequence.mjs": "7a38ce0b8bd5b4342a7bae09776b9638dc3ed51635322055a4fb0f0e6940af77",
|