-
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.
remove flavor tests, fix conflicts with test files already added else…
…where
- Loading branch information
1 parent
ee3ab13
commit 0252a71
Showing
78 changed files
with
866 additions
and
706 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
third_party/move/move-compiler-v2/tests/checking-lang-v1/anonymous_field_fail.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,34 @@ | ||
|
||
Diagnostics: | ||
error: unsupported language construct | ||
┌─ tests/checking-lang-v1/anonymous_field_fail.move:2:13 | ||
│ | ||
2 │ struct S(u8); | ||
│ ^ Move 2 language construct is not enabled: positional fields | ||
|
||
error: unsupported language construct | ||
┌─ tests/checking-lang-v1/anonymous_field_fail.move:4:5 | ||
│ | ||
4 │ enum E { | ||
│ ^^^^ Move 2 language construct is not enabled: enum types | ||
|
||
error: unsupported language construct | ||
┌─ tests/checking-lang-v1/anonymous_field_fail.move:5:10 | ||
│ | ||
5 │ V(S) | ||
│ ^ Move 2 language construct is not enabled: positional fields | ||
|
||
error: unsupported language construct | ||
┌─ tests/checking-lang-v1/anonymous_field_fail.move:9:11 | ||
│ | ||
9 │ x.1; | ||
│ ^ Move 2 language construct is not enabled: positional field | ||
|
||
error: unexpected token | ||
┌─ tests/checking-lang-v1/anonymous_field_fail.move:10:14 | ||
│ | ||
10 │ let S(_x) = x; | ||
│ ^ | ||
│ │ | ||
│ Unexpected '(' | ||
│ Expected '{' |
15 changes: 15 additions & 0 deletions
15
third_party/move/move-compiler-v2/tests/checking-lang-v1/anonymous_field_fail.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 @@ | ||
module 0x42::test { | ||
struct S(u8); | ||
|
||
enum E { | ||
V(S) | ||
} | ||
|
||
fun foo(x: S, y: E) { | ||
x.1; | ||
let S(_x) = x; | ||
match (y) { | ||
E::V(_y) => {} | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
third_party/move/move-compiler-v2/tests/checking-lang-v1/dotdot_not_supported.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,7 @@ | ||
|
||
Diagnostics: | ||
error: unsupported language construct | ||
┌─ tests/checking-lang-v1/dotdot_not_supported.move:8:11 | ||
│ | ||
8 │ let S { .. } = x; | ||
│ ^^ Move 2 language construct is not enabled: `..` patterns |
10 changes: 10 additions & 0 deletions
10
third_party/move/move-compiler-v2/tests/checking-lang-v1/dotdot_not_supported.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,10 @@ | ||
module 0x42::test { | ||
struct S { | ||
x: bool, | ||
y: u8 | ||
} | ||
|
||
fun test_0(x: S) { | ||
let S { .. } = x; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
third_party/move/move-compiler-v2/tests/checking-lang-v1/public_packge_visibility.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: | ||
error: unsupported language construct | ||
┌─ tests/checking-lang-v1/public_packge_visibility.move:2:5 | ||
│ | ||
2 │ public(package) fun foo() {} | ||
│ ^^^^^^^^^^^^^^^ Move 2 language construct is not enabled: public(package) visibility | ||
|
||
error: unsupported language construct | ||
┌─ tests/checking-lang-v1/public_packge_visibility.move:6:5 | ||
│ | ||
6 │ public(package) fun main() {} | ||
│ ^^^^^^^^^^^^^^^ Move 2 language construct is not enabled: public(package) visibility |
7 changes: 7 additions & 0 deletions
7
third_party/move/move-compiler-v2/tests/checking-lang-v1/public_packge_visibility.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,7 @@ | ||
module 0x42::M { | ||
public(package) fun foo() {} | ||
} | ||
|
||
script { | ||
public(package) fun main() {} | ||
} |
2 changes: 2 additions & 0 deletions
2
third_party/move/move-compiler-v2/tests/more-v1/expansion/address_directives.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,2 @@ | ||
|
||
============ bytecode verification succeeded ======== |
54 changes: 54 additions & 0 deletions
54
third_party/move/move-compiler-v2/tests/more-v1/expansion/address_directives.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,54 @@ | ||
module 0x1::M { | ||
|
||
} | ||
|
||
address 0x2 { | ||
|
||
module M { | ||
struct X {} | ||
|
||
public fun x(): X { | ||
X { } | ||
} | ||
|
||
} | ||
|
||
} | ||
|
||
address 0x3{} | ||
address 0x4{} | ||
address 0x2{} | ||
address 0x4{ | ||
|
||
module M { | ||
use 0x2::M; | ||
|
||
struct X {} | ||
|
||
public fun x(): X { | ||
X {} | ||
} | ||
|
||
public fun both(): (X, M::X) { | ||
(X { }, M::x()) | ||
} | ||
|
||
} | ||
|
||
} | ||
|
||
address 0x2 { | ||
|
||
module M2 { | ||
use 0x2::M as M1; | ||
use 0x4::M as M3; | ||
|
||
struct X {} | ||
|
||
public fun x(): (M1::X, X, M3::X) { | ||
(M1::x(), X {}, M3::x()) | ||
} | ||
|
||
} | ||
|
||
} |
2 changes: 2 additions & 0 deletions
2
third_party/move/move-compiler-v2/tests/more-v1/expansion/address_directives_empty.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,2 @@ | ||
|
||
============ bytecode verification succeeded ======== |
4 changes: 4 additions & 0 deletions
4
third_party/move/move-compiler-v2/tests/more-v1/expansion/address_directives_empty.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,4 @@ | ||
address 0x3 {} | ||
address 0x4 {} | ||
address 0x2 {} | ||
address 0x4 {} |
2 changes: 2 additions & 0 deletions
2
third_party/move/move-compiler-v2/tests/more-v1/expansion/almost_invalid_local_name.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,2 @@ | ||
|
||
============ bytecode verification succeeded ======== |
21 changes: 21 additions & 0 deletions
21
third_party/move/move-compiler-v2/tests/more-v1/expansion/almost_invalid_local_name.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,21 @@ | ||
module 0x8675309::M { | ||
struct F has drop { No: u64 } | ||
|
||
fun t(_No: u64) { | ||
} | ||
|
||
fun t2() { | ||
let _No = 100; | ||
} | ||
|
||
fun t3() { | ||
let _No; | ||
_No = 100; | ||
} | ||
|
||
fun t4() { | ||
let _No = 100; | ||
F { No: _No }; | ||
} | ||
|
||
} |
2 changes: 2 additions & 0 deletions
2
third_party/move/move-compiler-v2/tests/more-v1/expansion/entry_main.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,2 @@ | ||
|
||
============ bytecode verification succeeded ======== |
4 changes: 4 additions & 0 deletions
4
third_party/move/move-compiler-v2/tests/more-v1/expansion/entry_main.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,4 @@ | ||
script { | ||
entry fun main() { | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
third_party/move/move-compiler-v2/tests/more-v1/expansion/multiple_alias.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,2 @@ | ||
|
||
============ bytecode verification succeeded ======== |
26 changes: 26 additions & 0 deletions
26
third_party/move/move-compiler-v2/tests/more-v1/expansion/multiple_alias.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,26 @@ | ||
address 0x2 { | ||
|
||
module M { | ||
use 0x2::X; | ||
use 0x2::X as X2; | ||
|
||
struct F { | ||
f: 0x2::X::S, | ||
g: X::S, | ||
h: X2::S, | ||
} | ||
|
||
fun foo(_x: 0x2::X::S, _y: X::S, _z: X2::S): (0x2::X::S, X::S, X2::S) { | ||
let a : 0x2::X::S = 0x2::X::foo(); | ||
let b : X::S = X::foo(); | ||
let c : X2::S = X2::foo(); | ||
(a, b, c) | ||
} | ||
} | ||
|
||
module X { | ||
struct S has drop {} | ||
public fun foo(): S { S{} } | ||
} | ||
|
||
} |
2 changes: 2 additions & 0 deletions
2
third_party/move/move-compiler-v2/tests/more-v1/expansion/number_literal_long.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,2 @@ | ||
|
||
============ bytecode verification succeeded ======== |
8 changes: 8 additions & 0 deletions
8
third_party/move/move-compiler-v2/tests/more-v1/expansion/number_literal_long.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,8 @@ | ||
module 0x8675309::M { | ||
fun foo() { | ||
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; | ||
0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001; | ||
(340282366920938463463374607431768211454: u128); | ||
(0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF: u128); | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
third_party/move/move-compiler-v2/tests/more-v1/expansion/pack_all_field_cases.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,2 @@ | ||
|
||
============ bytecode verification succeeded ======== |
14 changes: 14 additions & 0 deletions
14
third_party/move/move-compiler-v2/tests/more-v1/expansion/pack_all_field_cases.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,14 @@ | ||
module 0x8675309::M { | ||
struct T has drop {} | ||
struct S has drop { f: u64, g: u64 } | ||
fun foo() { | ||
let f = 0; | ||
let g = 1; | ||
T {}; | ||
T { }; | ||
S { f, g }; | ||
S { f: 0, g: 0}; | ||
S { g: 0, f }; | ||
S { g, f: 0 }; | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
third_party/move/move-compiler-v2/tests/more-v1/expansion/restricted_names_valid.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,2 @@ | ||
|
||
============ bytecode verification succeeded ======== |
72 changes: 72 additions & 0 deletions
72
third_party/move/move-compiler-v2/tests/more-v1/expansion/restricted_names_valid.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,72 @@ | ||
address 0x2 { | ||
module N { | ||
public fun t(): u64 { 0 } | ||
} | ||
|
||
module M { | ||
use 0x2::N::{ | ||
Self as address, | ||
Self as signer, | ||
Self as u8, | ||
Self as u64, | ||
Self as u128, | ||
// vector now keyworded in expressions, so this would be unusable | ||
// Self as vector, | ||
Self as move_to, | ||
Self as move_from, | ||
Self as borrow_global, | ||
Self as borrow_global_mut, | ||
Self as exists, | ||
Self as freeze, | ||
Self as assert, | ||
}; | ||
|
||
fun t(): u64 { | ||
|
||
let address = 0; | ||
let signer = 0; | ||
let u8 = 0; | ||
let u64 = 0; | ||
let u128 = 0; | ||
// vector now keyworded in expressions, so this would be unusable | ||
// let vector = 0; | ||
let move_to = 0; | ||
let move_from = 0; | ||
let borrow_global = 0; | ||
let borrow_global_mut = 0; | ||
let exists = 0; | ||
let freeze = 0; | ||
let assert = 0; | ||
|
||
address::t() + | ||
signer::t() + | ||
u8::t() + | ||
u64::t() + | ||
u128::t() + | ||
// vector now keyworded in expressions, so this would fail in parsing | ||
// vector::t() + | ||
move_to::t() + | ||
move_from::t() + | ||
borrow_global::t() + | ||
borrow_global_mut::t() + | ||
exists::t() + | ||
freeze::t() + | ||
assert::t(); | ||
|
||
address + | ||
signer + | ||
u8 + | ||
u64 + | ||
u128 + | ||
// vector now keyworded in expressions, so this would fail in parsing | ||
// vector + | ||
move_to + | ||
move_from + | ||
borrow_global + | ||
borrow_global_mut + | ||
exists + | ||
freeze + | ||
assert | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
third_party/move/move-compiler-v2/tests/more-v1/expansion/spec_block_uses.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,19 @@ | ||
|
||
Diagnostics: | ||
error: cannot use `u256` with an operator which expects a value of type `address` | ||
┌─ tests/more-v1/expansion/spec_block_uses.move:12:32 | ||
│ | ||
12 │ ensures exists<S<u64>>(0x1) == exists<R>(0x1); | ||
│ ^^^ | ||
|
||
error: cannot use `u256` with an operator which expects a value of type `address` | ||
┌─ tests/more-v1/expansion/spec_block_uses.move:12:50 | ||
│ | ||
12 │ ensures exists<S<u64>>(0x1) == exists<R>(0x1); | ||
│ ^^^ | ||
|
||
error: `ensures` not allowed in module context | ||
┌─ tests/more-v1/expansion/spec_block_uses.move:12:9 | ||
│ | ||
12 │ ensures exists<S<u64>>(0x1) == exists<R>(0x1); | ||
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
20 changes: 20 additions & 0 deletions
20
third_party/move/move-compiler-v2/tests/more-v1/expansion/spec_block_uses.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,20 @@ | ||
address 0x2 { | ||
module M { | ||
struct S {} | ||
struct R<T> { f: T } | ||
|
||
fun t1(): (R<u64>, S) { | ||
abort 0 | ||
} | ||
|
||
spec module { | ||
use 0x2::M::{S as R, R as S}; | ||
ensures exists<S<u64>>(0x1) == exists<R>(0x1); | ||
} | ||
|
||
fun t2(): (R<u64>, S) { | ||
abort 0 | ||
} | ||
|
||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...d_party/move/move-compiler-v2/tests/more-v1/expansion/spec_block_uses_shadows_defines.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,19 @@ | ||
|
||
Diagnostics: | ||
error: cannot use `u256` with an operator which expects a value of type `address` | ||
┌─ tests/more-v1/expansion/spec_block_uses_shadows_defines.move:16:32 | ||
│ | ||
16 │ ensures exists<S<u64>>(0x1) == exists<R>(0x1); | ||
│ ^^^ | ||
|
||
error: cannot use `u256` with an operator which expects a value of type `address` | ||
┌─ tests/more-v1/expansion/spec_block_uses_shadows_defines.move:16:50 | ||
│ | ||
16 │ ensures exists<S<u64>>(0x1) == exists<R>(0x1); | ||
│ ^^^ | ||
|
||
error: `ensures` not allowed in module context | ||
┌─ tests/more-v1/expansion/spec_block_uses_shadows_defines.move:16:9 | ||
│ | ||
16 │ ensures exists<S<u64>>(0x1) == exists<R>(0x1); | ||
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Oops, something went wrong.