From d959d36649927e548e99b14e429a23081c3006cb Mon Sep 17 00:00:00 2001 From: Xie Yuheng Date: Mon, 30 Sep 2024 09:28:00 +0800 Subject: [PATCH] up --- src/propagators/conditional.test.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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) + } })