diff --git a/src/propagators/conditional.test.ts b/src/propagators/conditional.test.ts index aae5cca..4b84e3c 100644 --- a/src/propagators/conditional.test.ts +++ b/src/propagators/conditional.test.ts @@ -1,8 +1,9 @@ import assert from "node:assert" import test from "node:test" import { patch } from "../cell/index.js" +import { nothing } from "../nothing/index.js" import { run } from "../scheduler/index.js" -import { conditional } from "./conditional.js" +import { conditional, conditionalWriter } from "./conditional.js" test("propagators / conditional", async () => { { @@ -13,4 +14,13 @@ test("propagators / conditional", async () => { await run() assert(output.content === 1) } + + { + const [control, input, ifTrue, ifFalse] = conditionalWriter() + patch(control, true) + patch(input, 6) + await run() + assert(ifTrue.content === 6) + assert(ifFalse.content === nothing) + } })