Skip to content

Commit

Permalink
add embed join behavior test
Browse files Browse the repository at this point in the history
  • Loading branch information
monoid committed Aug 7, 2024
1 parent 97fe1ce commit c8f8297
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions air/tests/test_module/instructions/embed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,23 @@ async fn embed_error_lexer() {
));
assert_error_eq!(&result, expected_error);
}

#[tokio::test]
async fn embed_with_join_behavior() {
let mut vm = create_avm(echo_call_service(), "").await;

let script = r##"
(par
(call "other_peer" ("" "") [] var)
(seq
(embed [var] #"var + var"# var2)
(call %init_peer_id% ("" "") [var2])))"##;

let result = call_vm!(vm, <_>::default(), script, "", "");

assert_eq!(result.error_message, "");
assert_eq!(result.ret_code, 0);

let trace = trace_from_result(&result);
assert_eq!(trace.len(), 2);
}

0 comments on commit c8f8297

Please sign in to comment.