Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuheng committed Sep 30, 2024
1 parent 1c22b36 commit d959d36
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/propagators/conditional.test.ts
Original file line number Diff line number Diff line change
@@ -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 () => {
{
Expand All @@ -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)
}
})

0 comments on commit d959d36

Please sign in to comment.