tests: extend audited rejection twins through tasks and locks

This commit is contained in:
dev committed 2026-10-08 18:12:53 +03:00
1 parent e4aacef48c
commit 272aebfd32
16 files changed
+157 -13

No files matched your search

@@ -3,6 +3,7 @@
// phase: 6
// spec: docs/spec/15-source-language.md
module demo.call_waiting_function
// AIR twin: phase3/reject/sync_call_waiting_function.air
fn pause() -> void
effects [task.wait]
@@ -14,7 +15,7 @@ effects [task.wait]
{
let m = mutex.make(0u64);
lock ref m as c {
pause();
pause(); // diagnostic here
*c = 1;
} cancelled {}
mutex.take(move m)
@@ -3,6 +3,7 @@
// phase: 6
// spec: docs/spec/15-source-language.md
module demo.lock_twice
// AIR twin: phase3/reject/sync_lock_twice.air
fn main() -> u64
effects [task.wait]
@@ -10,7 +11,7 @@ effects [task.wait]
let a = mutex.make(0u64);
let b = mutex.make(0u64);
lock ref a as x {
lock ref b as y {
lock ref b as y { // diagnostic here
*y = *x;
} cancelled {}
} cancelled {}
@@ -3,6 +3,7 @@
// phase: 6
// spec: docs/spec/15-source-language.md
module demo.wait_while_locked
// AIR twin: phase3/reject/sync_wait_while_locked.air
fn main(heap: cap<mem.alloc>) -> u64
effects [mem.alloc, task.wait]
@@ -11,7 +12,7 @@ effects [mem.alloc, task.wait]
match channel.make<u64>(1, heap) {
ok(tx, rx) => {
lock ref m as c {
*c = channel.recv(rx) or trap;
*c = channel.recv(rx) or trap; // diagnostic here: channel.recv
} cancelled {}
channel.close_sender(move tx);
channel.close_receiver(move rx) or trap;