From c8f8297b3c826b87956ba5c9aa84571ffc5eac9f Mon Sep 17 00:00:00 2001 From: Ivan Boldyrev Date: Wed, 7 Aug 2024 10:49:02 +0200 Subject: [PATCH] add embed join behavior test --- air/tests/test_module/instructions/embed.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/air/tests/test_module/instructions/embed.rs b/air/tests/test_module/instructions/embed.rs index edb49f958..5f1203b87 100644 --- a/air/tests/test_module/instructions/embed.rs +++ b/air/tests/test_module/instructions/embed.rs @@ -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); +}