Skip to content

Commit 2533e1e

Browse files
authored
[move-ide] Removed test dependency on Sui framework (#17158)
## Description This PR removed a dependency of move-analyzer's tests on Sui framework code. ## Test plan Testing for implicit imports has been made dependent on Move stdlib instead.
1 parent 45c2505 commit 2533e1e

File tree

3 files changed

+14
-29
lines changed

3 files changed

+14
-29
lines changed

crates/move-analyzer/src/symbols.rs

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6629,40 +6629,26 @@ fn implicit_uses_test() {
66296629
&symbols,
66306630
1,
66316631
3,
6632-
12,
6632+
13,
66336633
"implicit_uses.move",
6634-
64,
6635-
18,
6636-
"object.move",
6637-
"public struct sui::object::UID has store {\n\tid: sui::object::ID\n}",
6638-
Some((64, 18, "object.move")),
6639-
);
6640-
// implicit struct as parameter type
6641-
assert_use_def(
6642-
mod_symbols,
6643-
&symbols,
6644-
2,
66456634
6,
6646-
29,
6647-
"implicit_uses.move",
6648-
20,
6649-
18,
6650-
"tx_context.move",
6651-
"public struct sui::tx_context::TxContext has drop {\n\tepoch: u64,\n\tepoch_timestamp_ms: u64,\n\tids_created: u64,\n\tsender: address,\n\ttx_hash: vector<u8>\n}",
6652-
Some((20, 18, "tx_context.move")),
6635+
11,
6636+
"option.move",
6637+
"public struct std::option::Option<Element> has copy, drop, store {\n\tvec: vector<Element>\n}",
6638+
Some((6, 11, "option.move")),
66536639
);
66546640
// implicit module name in function call
66556641
assert_use_def(
66566642
mod_symbols,
66576643
&symbols,
66586644
2,
66596645
7,
6660-
18,
6646+
26,
66616647
"implicit_uses.move",
6662-
4,
6648+
1,
66636649
12,
6664-
"object.move",
6665-
"module sui::object",
6650+
"option.move",
6651+
"module std::option",
66666652
None,
66676653
);
66686654
}

crates/move-analyzer/tests/move-2024/Move.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ name = "Move2024"
33
version = "0.0.1"
44
edition = "2024.beta"
55

6-
#include Sui as dependency to test that importing it does not crash the symbolicator
76
[dependencies]
8-
Sui = { local = "../../../../../../crates/sui-framework/packages/sui-framework/" }
7+
MoveStdlib = { local = "../../../move-stdlib/", addr_subst = { "std" = "0x1" } }
98

109
[addresses]
1110
Move2024 = "0xCAFE"
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
module Move2024::implicit_uses {
22

3-
public struct Obj {
4-
id: UID
3+
public struct SomeStruct {
4+
opt: Option<u8>,
55
}
66

7-
public fun foo(ctx: &mut TxContext): Obj {
8-
Obj { id: object::new(ctx) }
7+
public fun foo(): SomeStruct {
8+
SomeStruct { opt: option::some(42) }
99
}
1010
}

0 commit comments

Comments
 (0)