From 96efebeeeccc6eb03fea6588bd193f3b7c118f27 Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Wed, 18 Nov 2026 12:56:54 +0800 Subject: [PATCH] test(environment): distinguish the earliest rewrite cutoff (#11988) --- .../analysisView/environmentStateRewrites.test.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/domain/analysisView/environmentStateRewrites.test.ts b/src/domain/analysisView/environmentStateRewrites.test.ts index fade955ac1..8290aaf922 100644 --- a/src/domain/analysisView/environmentStateRewrites.test.ts +++ b/src/domain/analysisView/environmentStateRewrites.test.ts @@ -4,7 +4,6 @@ import { StateRecordChronology } from "./StateRecordChronology.js"; import { rewriteCuts } from "./environmentStateRewrites.js"; import { writeSpanCheck, - writeSpanIndex, type StateRecordFacts, } from "./environmentStateRules.js"; @@ -79,15 +78,14 @@ it("selects the earliest possibly interfering write without replacing a known co const finished = record(0, "PUT", 0, 5); const unresolved = record(1, "PUT", 10, undefined); const earlier = record(2, "GET", 20, 25); - const later = record(3, "GET", 30, 35); - const records = [finished, unresolved, earlier, later]; + const overlap = record(3, "PUT", 26, 27); + const later = record(4, "GET", 30, 35); + const records = [finished, unresolved, earlier, overlap, later]; const chronology = new StateRecordChronology(records, "recorded-start-time"); - const writes = [finished, unresolved]; - expect(writeSpanIndex(writes, chronology)(earlier, later)).toBe(1); expect( rewriteCuts( [{ type: "/api/items", earlier: earlier.ordinal, later: later.ordinal }], - writes, + [finished, unresolved, overlap], new Map(records.map((value) => [value.ordinal, value])), chronology, ).get("/api/items"),