Skip to content

Commit

Permalink
add a lambda transactional-test, clean up test driver a bit to improv…
Browse files Browse the repository at this point in the history
…e coverage of existing tests (#15463)

* add a lambda transactional-test.  while modifying test config, add a baseline test config to ensure we are running baseline for all tests.
  • Loading branch information
brmataptos authored Dec 18, 2024
1 parent ac9302a commit 9a6cc6f
Show file tree
Hide file tree
Showing 38 changed files with 2,264 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

Diagnostics:
error: unexpected token
┌─ tests/lambda/inline-parity/subtype_args_ok.move:23:37
23 │ fun t2(f: |&u64, &mut u64| with copy) {
│ - ^ Expected ')'
│ │
│ To match this '('
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

Diagnostics:
error: unexpected token
┌─ tests/lambda/inline-parity/subtype_args_ok.move:23:37
23 │ fun t2(f: |&u64, &mut u64| with copy) {
│ - ^ Expected ')'
│ │
│ To match this '('
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module 0x8675309::M {
struct S has drop {}

fun imm<T>(_x: &T) {}
fun imm_mut<T>(_x: &T, _y: &mut T) {}
fun mut_imm<T>(_x: &mut T, _y: &T) {}
fun imm_imm<T>(_x: &T, _y: &T) {}

fun t0() {
imm(&mut 0);
imm(&0);

imm(&mut S{});
imm(&S{});
}

fun t1() {
imm_mut(&mut 0, &mut 0);
mut_imm(&mut 0, &mut 0);
imm_imm(&mut 0, &mut 0);
}

fun t2(f: |&u64, &mut u64| with copy) {
f(&mut 0, &mut 0);
f(&0, &mut 0);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

Diagnostics:
error: unsupported language construct
┌─ tests/lambda/storable/generic_func.move:36:18
36 │ let f1 = move |addr| 0x42::mod2::item_exists<MyStruct1>(addr) with store+copy;
│ ^^^^ Move 2.2 language construct is not enabled: Modifier on lambda expression

error: unsupported language construct
┌─ tests/lambda/storable/generic_func.move:36:71
36 │ let f1 = move |addr| 0x42::mod2::item_exists<MyStruct1>(addr) with store+copy;
│ ^^^^^^^^^^^^^^^ Move 2.2 language construct is not enabled: Abilities on function expressions

error: unsupported language construct
┌─ tests/lambda/storable/generic_func.move:37:18
37 │ let f2 = move |addr| 0x42::mod2::item_exists<MyStruct2>(addr) with store+copy;
│ ^^^^ Move 2.2 language construct is not enabled: Modifier on lambda expression

error: unsupported language construct
┌─ tests/lambda/storable/generic_func.move:37:71
37 │ let f2 = move |addr| 0x42::mod2::item_exists<MyStruct2>(addr) with store+copy;
│ ^^^^^^^^^^^^^^^ Move 2.2 language construct is not enabled: Abilities on function expressions

error: unsupported language construct
┌─ tests/lambda/storable/generic_func.move:53:55
53 │ assert!(0x42::mod2::item_exists<|address|bool with store+copy>(addr));
│ ^^^^^^^^^^^^^^^ Move 2.2 language construct is not enabled: Ability constraints on function types

error: unsupported language construct
┌─ tests/lambda/storable/generic_func.move:55:58
55 │ let found_f = 0x42::mod2::get_item<|address|bool with store+copy>(addr);
│ ^^^^^^^^^^^^^^^ Move 2.2 language construct is not enabled: Ability constraints on function types
Loading

0 comments on commit 9a6cc6f

Please sign in to comment.