Skip to content

Commit 9a6cc6f

Browse files
authored
add a lambda transactional-test, clean up test driver a bit to improve coverage of existing tests (aptos-labs#15463)
* add a lambda transactional-test. while modifying test config, add a baseline test config to ensure we are running baseline for all tests.
1 parent ac9302a commit 9a6cc6f

38 files changed

+2264
-33
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
Diagnostics:
3+
error: unexpected token
4+
┌─ tests/lambda/inline-parity/subtype_args_ok.move:23:37
5+
6+
23 │ fun t2(f: |&u64, &mut u64| with copy) {
7+
│ - ^ Expected ')'
8+
│ │
9+
│ To match this '('
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
Diagnostics:
3+
error: unexpected token
4+
┌─ tests/lambda/inline-parity/subtype_args_ok.move:23:37
5+
6+
23 │ fun t2(f: |&u64, &mut u64| with copy) {
7+
│ - ^ Expected ')'
8+
│ │
9+
│ To match this '('
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
module 0x8675309::M {
2+
struct S has drop {}
3+
4+
fun imm<T>(_x: &T) {}
5+
fun imm_mut<T>(_x: &T, _y: &mut T) {}
6+
fun mut_imm<T>(_x: &mut T, _y: &T) {}
7+
fun imm_imm<T>(_x: &T, _y: &T) {}
8+
9+
fun t0() {
10+
imm(&mut 0);
11+
imm(&0);
12+
13+
imm(&mut S{});
14+
imm(&S{});
15+
}
16+
17+
fun t1() {
18+
imm_mut(&mut 0, &mut 0);
19+
mut_imm(&mut 0, &mut 0);
20+
imm_imm(&mut 0, &mut 0);
21+
}
22+
23+
fun t2(f: |&u64, &mut u64| with copy) {
24+
f(&mut 0, &mut 0);
25+
f(&0, &mut 0);
26+
}
27+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
Diagnostics:
3+
error: unsupported language construct
4+
┌─ tests/lambda/storable/generic_func.move:36:18
5+
6+
36 │ let f1 = move |addr| 0x42::mod2::item_exists<MyStruct1>(addr) with store+copy;
7+
│ ^^^^ Move 2.2 language construct is not enabled: Modifier on lambda expression
8+
9+
error: unsupported language construct
10+
┌─ tests/lambda/storable/generic_func.move:36:71
11+
12+
36 │ let f1 = move |addr| 0x42::mod2::item_exists<MyStruct1>(addr) with store+copy;
13+
│ ^^^^^^^^^^^^^^^ Move 2.2 language construct is not enabled: Abilities on function expressions
14+
15+
error: unsupported language construct
16+
┌─ tests/lambda/storable/generic_func.move:37:18
17+
18+
37 │ let f2 = move |addr| 0x42::mod2::item_exists<MyStruct2>(addr) with store+copy;
19+
│ ^^^^ Move 2.2 language construct is not enabled: Modifier on lambda expression
20+
21+
error: unsupported language construct
22+
┌─ tests/lambda/storable/generic_func.move:37:71
23+
24+
37 │ let f2 = move |addr| 0x42::mod2::item_exists<MyStruct2>(addr) with store+copy;
25+
│ ^^^^^^^^^^^^^^^ Move 2.2 language construct is not enabled: Abilities on function expressions
26+
27+
error: unsupported language construct
28+
┌─ tests/lambda/storable/generic_func.move:53:55
29+
30+
53 │ assert!(0x42::mod2::item_exists<|address|bool with store+copy>(addr));
31+
│ ^^^^^^^^^^^^^^^ Move 2.2 language construct is not enabled: Ability constraints on function types
32+
33+
error: unsupported language construct
34+
┌─ tests/lambda/storable/generic_func.move:55:58
35+
36+
55 │ let found_f = 0x42::mod2::get_item<|address|bool with store+copy>(addr);
37+
│ ^^^^^^^^^^^^^^^ Move 2.2 language construct is not enabled: Ability constraints on function types

0 commit comments

Comments
 (0)