1
1
import assert from "node:assert"
2
2
import { test } from "node:test"
3
- import { Cell , put } from "../cell/index.js"
3
+ import { Cell , patch } from "../cell/index.js"
4
4
import { Interval , intervalAlmostEqual } from "../interval/index.js"
5
5
import { run } from "../scheduler/index.js"
6
6
import { fallDuration , similarTriangles } from "./barometer.js"
7
7
8
8
test ( "examples / barometer / fallDuration" , async ( ) => {
9
9
const [ fallTime , buildingHeight ] = fallDuration ( )
10
- put ( fallTime , Interval ( 2.9 , 3.1 ) )
10
+ patch ( fallTime , Interval ( 2.9 , 3.1 ) )
11
11
12
12
await run ( )
13
13
@@ -18,15 +18,15 @@ test("examples / barometer / fallDuration", async () => {
18
18
19
19
test ( "examples / barometer / fallDuration / Interval + Number" , async ( ) => {
20
20
const [ fallTime , buildingHeight ] = fallDuration ( )
21
- put ( fallTime , Interval ( 2.9 , 3.1 ) )
21
+ patch ( fallTime , Interval ( 2.9 , 3.1 ) )
22
22
23
23
await run ( )
24
24
25
25
assert (
26
26
intervalAlmostEqual ( buildingHeight . content , Interval ( 41.16 , 47.24 ) , 0.01 ) ,
27
27
)
28
28
29
- put ( buildingHeight , 45 )
29
+ patch ( buildingHeight , 45 )
30
30
31
31
await run ( )
32
32
@@ -36,9 +36,9 @@ test("examples / barometer / fallDuration / Interval + Number", async () => {
36
36
test ( "examples / barometer / similarTriangles & fallDuration" , async ( ) => {
37
37
const [ barometerShadow , barometerHeight , buildingShadow , buildingHeight ] =
38
38
similarTriangles ( )
39
- put ( buildingShadow , Interval ( 54.9 , 55.1 ) )
40
- put ( barometerHeight , Interval ( 0.3 , 0.32 ) )
41
- put ( barometerShadow , Interval ( 0.36 , 0.37 ) )
39
+ patch ( buildingShadow , Interval ( 54.9 , 55.1 ) )
40
+ patch ( barometerHeight , Interval ( 0.3 , 0.32 ) )
41
+ patch ( barometerShadow , Interval ( 0.36 , 0.37 ) )
42
42
43
43
await run ( )
44
44
@@ -48,7 +48,7 @@ test("examples / barometer / similarTriangles & fallDuration", async () => {
48
48
49
49
const fallTime = Cell ( )
50
50
fallDuration ( fallTime , buildingHeight )
51
- put ( fallTime , Interval ( 2.9 , 3.1 ) )
51
+ patch ( fallTime , Interval ( 2.9 , 3.1 ) )
52
52
53
53
await run ( )
54
54
0 commit comments