Skip to content

Commit

Permalink
update hoon kernels and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ryjm committed Jan 23, 2025
1 parent 43e922f commit aecdcce
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion apps/choo/bootstrap/kernel.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
:: +poke: external apply
::
++ poke
|= [eny=@ our=@ux now=@da dat=*]
|= [=wire eny=@ our=@ux now=@da dat=*]
^- [(list effect) choo-state]
=/ cause=(unit cause) ((soft cause) dat)
?~ cause
Expand Down
6 changes: 3 additions & 3 deletions apps/hoon-deps/lib/wrapper.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
|~ arg=path
*(unit (unit *))
++ poke
|~ arg=input
|~ arg=ovum
[*(list *) *inner-state]
--
--
Expand Down Expand Up @@ -77,7 +77,7 @@
=- [effects ..poke]
(slog tang.goof.u.g)
::
[[%poke ~] *]
[[%poke *] *]
=/ ovum ((soft ^ovum) ovum)
?~ ovum ~&("invalid arg: {<ovum>}" ~^..poke)
=/ o ((soft input) input.u.ovum)
Expand All @@ -86,7 +86,7 @@
=+ (road |.(;;(^^ovum ovum)))
~^..poke
=^ effects internal.outer
(poke:inner-fort input.u.ovum)
(poke:inner-fort u.ovum)
[effects ..poke(internal.outer internal.outer)]
==
--
Expand Down
2 changes: 1 addition & 1 deletion apps/http-app/bootstrap/kernel.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
:: +poke: external apply
::
++ poke
|= [eny=@ our=@ux now=@da dat=*]
|= [=wire eny=@ our=@ux now=@da dat=*]
^- [(list effect) server-state]
=/ sof-cau=(unit cause) ((soft cause) dat)
?~ sof-cau
Expand Down
4 changes: 3 additions & 1 deletion apps/test-app/bootstrap/kernel.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
::
++ load
|= arg=test-state
~& >> "load"
arg
::
:: +peek: external inspect
Expand All @@ -38,8 +39,9 @@
:: +poke: external apply
::
++ poke
|= [eny=@ our=@ux now=@da dat=*]
|= [=wire eny=@ our=@ux now=@da dat=*]
^- [(list effect) test-state]
~& >> "poke: {<wire>}"
=/ sof-cau=(unit cause) ((soft cause) dat)
?~ sof-cau
~& "cause incorrectly formatted!"
Expand Down
Binary file modified apps/test-app/bootstrap/test-ker.jam
Binary file not shown.
13 changes: 10 additions & 3 deletions crown/src/nockapp/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ mod tests {
}

#[tokio::test]
#[traced_test]
#[cfg_attr(miri, ignore)]
async fn test_nockapp_save_multiple() {
let (_temp, mut nockapp) = setup_nockapp("test-ker.jam");
Expand Down Expand Up @@ -198,11 +199,17 @@ mod tests {
// Checkpointed state should have been incremented
let peek = T(nockapp.kernel.serf.stack(), &[D(tas!(b"state")), D(0)]);

// res should be [~ ~ val]
// res should be [~ ~ [%0 val]]
let res = nockapp.kernel.peek(peek).unwrap();
let val = slot(res, 7).unwrap();
let val = slot(res, 7).unwrap().as_cell().unwrap().tail();

unsafe {
assert!(val.raw_equals(D(i)));
assert!(
val.raw_equals(D(i)),
"val: {:?} != expected: {:?}",
val,
D(i)
);
}
}
}
Expand Down
Binary file modified crown/test-jams/test-ker.jam
Binary file not shown.

0 comments on commit aecdcce

Please sign in to comment.