From 8fefb159d251fcddb6dcdf448326336f5e0ba80d Mon Sep 17 00:00:00 2001 From: Antonio Yang Date: Mon, 2 Dec 2024 17:59:41 +0800 Subject: [PATCH] [move-compiler] add test for cross module init call in sui-mode --- .../init/cross_module_init_function.move | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 external-crates/move/crates/move-compiler/tests/sui_mode/init/cross_module_init_function.move diff --git a/external-crates/move/crates/move-compiler/tests/sui_mode/init/cross_module_init_function.move b/external-crates/move/crates/move-compiler/tests/sui_mode/init/cross_module_init_function.move new file mode 100644 index 00000000000000..d3247f553ddb9a --- /dev/null +++ b/external-crates/move/crates/move-compiler/tests/sui_mode/init/cross_module_init_function.move @@ -0,0 +1,17 @@ +// check that fun `init` can be used cross module in sui-mode +module 0x1::M { + fun init(_ctx: &mut sui::tx_context::TxContext) { } +} + +module 0x1::Tests { + #[test] + fun tester() { + use 0x1::M; + let ctx = sui::tx_context::TxContext {}; + M::init(&ctx); + } +} + +module sui::tx_context { + struct TxContext has drop {} +}