Skip to content

Commit

Permalink
remove flavor tests, fix conflicts with test files already added else…
Browse files Browse the repository at this point in the history
…where
  • Loading branch information
brmataptos committed Sep 10, 2024
1 parent ee3ab13 commit 0252a71
Show file tree
Hide file tree
Showing 78 changed files with 866 additions and 706 deletions.
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 '{'
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) => {}
}
}
}
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
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;
}
}
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
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() {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

============ bytecode verification succeeded ========
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())
}

}

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

============ bytecode verification succeeded ========
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
address 0x3 {}
address 0x4 {}
address 0x2 {}
address 0x4 {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

============ bytecode verification succeeded ========
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 };
}

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

============ bytecode verification succeeded ========
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
script {
entry fun main() {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

============ bytecode verification succeeded ========
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{} }
}

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

============ bytecode verification succeeded ========
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);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

============ bytecode verification succeeded ========
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 };
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

============ bytecode verification succeeded ========
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
}
}
}
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);
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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
}

}
}
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);
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Loading

0 comments on commit 0252a71

Please sign in to comment.