-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add edited tests to dig deeper into differences between V1 and V2 tes…
…t outputs
- Loading branch information
1 parent
3f3b1d3
commit 7ddf345
Showing
8 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
third_party/move/move-compiler-v2/tests/checking/typing/recursive_constant.exp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// -- Model dump before bytecode pipeline | ||
module 0x42::M { | ||
public fun get_x(): u64 { | ||
false | ||
} | ||
public fun get_y(): u64 { | ||
false | ||
} | ||
} // end 0x42::M |
15 changes: 15 additions & 0 deletions
15
third_party/move/move-compiler-v2/tests/checking/typing/recursive_constant.move
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
address 0x42 { | ||
module M { | ||
const X: u64 = Y; | ||
const Y: u64 = X; | ||
const Z: u64 = 0; | ||
|
||
public fun get_x(): u64 { | ||
X | ||
} | ||
|
||
public fun get_y(): u64 { | ||
Y | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
third_party/move/move-compiler-v2/tests/more-v1/expansion/use_nested_self_as_invalid2.exp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
Diagnostics: | ||
warning: unused alias | ||
┌─ tests/more-v1/expansion/use_nested_self_as_invalid2.move:8:26 | ||
│ | ||
8 │ use 0x2::X::{Self as B, foo, S}; | ||
│ ^ Unused 'use' of alias 'B'. Consider removing it | ||
|
||
error: variants not allowed in this context | ||
┌─ tests/more-v1/expansion/use_nested_self_as_invalid2.move:10:19 | ||
│ | ||
10 │ struct X { f: X::S, f2: S } | ||
│ ^^^^ |
16 changes: 16 additions & 0 deletions
16
third_party/move/move-compiler-v2/tests/more-v1/expansion/use_nested_self_as_invalid2.move
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
address 0x2 { | ||
module X { | ||
struct S {} | ||
public fun foo() {} | ||
} | ||
|
||
module M { | ||
use 0x2::X::{Self as B, foo, S}; | ||
|
||
struct X { f: X::S, f2: S } | ||
fun bar() { | ||
// X::foo(); | ||
foo() | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
third_party/move/move-compiler/tests/move_check/expansion/use_nested_self_as_invalid2.exp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
warning[W09001]: unused alias | ||
┌─ tests/move_check/expansion/use_nested_self_as_invalid2.move:8:26 | ||
│ | ||
8 │ use 0x2::X::{Self as B, foo, S}; | ||
│ ^ Unused 'use' of alias 'B'. Consider removing it | ||
|
||
error[E03002]: unbound module | ||
┌─ tests/move_check/expansion/use_nested_self_as_invalid2.move:10:19 | ||
│ | ||
10 │ struct X { f: X::S, f2: S } | ||
│ ^ Unbound module or type alias 'X' | ||
|
16 changes: 16 additions & 0 deletions
16
third_party/move/move-compiler/tests/move_check/expansion/use_nested_self_as_invalid2.move
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
address 0x2 { | ||
module X { | ||
struct S {} | ||
public fun foo() {} | ||
} | ||
|
||
module M { | ||
use 0x2::X::{Self as B, foo, S}; | ||
|
||
struct X { f: X::S, f2: S } | ||
fun bar() { | ||
// X::foo(); | ||
foo() | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
third_party/move/move-compiler/tests/move_check/typing/recursive_constant.exp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
error[E04013]: invalid statement or expression in constant | ||
┌─ tests/move_check/typing/recursive_constant.move:3:20 | ||
│ | ||
3 │ const X: u64 = Y; | ||
│ ^ Other constants are not supported in constants | ||
|
||
error[E04013]: invalid statement or expression in constant | ||
┌─ tests/move_check/typing/recursive_constant.move:4:20 | ||
│ | ||
4 │ const Y: u64 = X; | ||
│ ^ Other constants are not supported in constants | ||
|
15 changes: 15 additions & 0 deletions
15
third_party/move/move-compiler/tests/move_check/typing/recursive_constant.move
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
address 0x42 { | ||
module M { | ||
const X: u64 = Y; | ||
const Y: u64 = X; | ||
const Z: u64 = 0; | ||
|
||
public fun get_x(): u64 { | ||
X | ||
} | ||
|
||
public fun get_y(): u64 { | ||
Y | ||
} | ||
} | ||
} |