Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Zekun Wang committed Jun 6, 2024
1 parent 35d8327 commit a01899e
Show file tree
Hide file tree
Showing 17 changed files with 464 additions and 305 deletions.
2 changes: 1 addition & 1 deletion third_party/move/move-compiler-v2/tests/testsuite.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ const TEST_CONFIGS: Lazy<BTreeMap<&str, TestConfig>> = Lazy::new(|| {
.set_experiment(Experiment::UNUSED_ASSIGNMENT_CHECK, true),
stop_after: StopAfter::BytecodePipeline(Some("UnusedAssignmentChecker")),
dump_ast: DumpLevel::None,
dump_bytecode: DumpLevel::EndStage,
dump_bytecode: DumpLevel::None,
dump_bytecode_filter: None,
},
// Tests for lambda lifting
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

Diagnostics:
warning: Unused parameter `a`. Consider removing or prefixing with an underscore: `_a`
┌─ tests/unused-assignment/unused_call_assign_shadow.move:2:13
2 │ fun foo(a: u8, _b: u8) {
│ ^

warning: Unused local variable `y`. Consider removing or prefixing with an underscore: `_y`
┌─ tests/unused-assignment/unused_call_assign_shadow.move:5:13
5 │ let y = 0;
│ ^

warning: Unused local variable `w`. Consider removing or prefixing with an underscore: `_w`
┌─ tests/unused-assignment/unused_call_assign_shadow.move:8:13
8 │ let w = bar(false);
│ ^

warning: Unused local variable `x`. Consider removing or prefixing with an underscore: `_x`
┌─ tests/unused-assignment/unused_call_assign_shadow.move:22:13
22 │ let x = 0;
│ ^

warning: Unused local variable `x`. Consider removing or prefixing with an underscore: `_x`
┌─ tests/unused-assignment/unused_call_assign_shadow.move:24:13
24 │ let x = 1;
│ ^


Diagnostics:
warning: Unused assignment to `x`. Consider removing or prefixing with an underscore: `_x`
┌─ tests/unused-assignment/unused_call_assign_shadow.move:4:9
4 │ x = x + 1;
│ ^^^^^^^^^

warning: Unused assignment to `w`. Consider removing or prefixing with an underscore: `_w`
┌─ tests/unused-assignment/unused_call_assign_shadow.move:8:17
8 │ let w = bar(false);
│ ^^^^^^^^^^

warning: Unused assignment to `y`. Consider removing or prefixing with an underscore: `_y`
┌─ tests/unused-assignment/unused_call_assign_shadow.move:14:13
14 │ y = y + 1;
│ ^^^^^^^^^

warning: Unused assignment to `y`. Consider removing or prefixing with an underscore: `_y`
┌─ tests/unused-assignment/unused_call_assign_shadow.move:16:13
16 │ y = y + 2;
│ ^^^^^^^^^
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module 0x42::test {
fun foo(a: u8, _b: u8) {
let x = 0;
x = x + 1;
let y = 0;
let _z = 42;
// unused call assignment
let w = bar(false);
}

fun bar(x: bool): u8 {
let y = 0;
if (x) {
y = y + 1;
} else {
y = y + 2;
};
42
}

fun baz() {
let x = 0;
// shadowing
let x = 1;
}
}
Loading

0 comments on commit a01899e

Please sign in to comment.