Skip to content

Commit

Permalink
propagators/constant.test
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuheng committed Sep 30, 2024
1 parent d959d36 commit 84384e8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 1 addition & 3 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

> https://github.com/cicada-lang/propagator/issues/4
propagators/constant.test
propagators/boolean
propagators/boolean.test
extract constantCell
global map about about nogood

`propagators/binaryAmb`
Expand Down
12 changes: 12 additions & 0 deletions src/propagators/constant.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import assert from "node:assert"
import test from "node:test"
import { nothing } from "../nothing/Nothing.js"
import { run } from "../scheduler/index.js"
import { constant } from "./constant.js"

test("propagators / constant", async () => {
const x = constant(1)()
assert(x.content === nothing)
await run()
assert(x.content === 1)
})

0 comments on commit 84384e8

Please sign in to comment.