mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-21 23:50:45 +00:00
Pause and resume now go through one process-level control plane that survives panel/terminal close: TransferRuntime + soft latches/epochs/walk registry, soft-then-hard resume, dual-epoch-safe progress, and no-owner soft control.
22 lines
779 B
TypeScript
22 lines
779 B
TypeScript
import assert from "node:assert/strict";
|
|
import test from "node:test";
|
|
|
|
import {
|
|
clearTransferCancelledTree,
|
|
isTransferCancelledFlag,
|
|
isTransferOrRootCancelled,
|
|
markTransferCancelledTree,
|
|
resetTransferCancelLatchesForTests,
|
|
} from "./transferCancelLatch";
|
|
|
|
test("cancel flags are process-global for root and children", () => {
|
|
resetTransferCancelLatchesForTests();
|
|
markTransferCancelledTree("parent", ["c1", "c2"]);
|
|
assert.equal(isTransferCancelledFlag("parent"), true);
|
|
assert.equal(isTransferOrRootCancelled("parent", "c1"), true);
|
|
assert.equal(isTransferCancelledFlag("other"), false);
|
|
clearTransferCancelledTree("parent", ["c1", "c2"]);
|
|
assert.equal(isTransferCancelledFlag("parent"), false);
|
|
assert.equal(isTransferCancelledFlag("c1"), false);
|
|
});
|