diff --git a/mobile/src/terminal/terminal-input-connection-gate.test.ts b/mobile/src/terminal/terminal-input-connection-gate.test.ts index 1cfa89d2d4e..08b08a2f43f 100644 --- a/mobile/src/terminal/terminal-input-connection-gate.test.ts +++ b/mobile/src/terminal/terminal-input-connection-gate.test.ts @@ -11,6 +11,8 @@ const sessionRouteSource = readFileSync( function routeSlice(anchorStart: string, anchorEnd: string): string { const start = sessionRouteSource.indexOf(anchorStart) expect(start).toBeGreaterThanOrEqual(0) + // Why: a duplicated start anchor would silently slice the wrong region. + expect(sessionRouteSource.indexOf(anchorStart, start + 1)).toBe(-1) const end = sessionRouteSource.indexOf(anchorEnd, start) expect(end).toBeGreaterThan(start) return sessionRouteSource.slice(start, end + anchorEnd.length)