From 558b30f3f36c319ea1414c69cd0ebd2aafaa50e1 Mon Sep 17 00:00:00 2001 From: Tim Cuthbertson Date: Sun, 19 Apr 2026 21:56:48 +1000 Subject: [PATCH] test effects: don't require effect at definition time --- std/test/test.kk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/std/test/test.kk b/std/test/test.kk index adf19d8..fa8e13f 100644 --- a/std/test/test.kk +++ b/std/test/test.kk @@ -146,7 +146,7 @@ pub fun expect-that(predicate: (a) -> bool, run: () -> |e> (), ?kk-file: string, ?kk-line: int): |e> () +pub fun group(name: string, f: () -> > (), ?kk-file: string, ?kk-line: int): > () val scope = Test-scope( scope-id = gen-test-id(), parent = current-scope, @@ -169,7 +169,7 @@ pub fun hint(value: string): expect () // (the call to `effectful-test`) and test execution (the call to `run-tests`). // // Use `test` function where possible, as it ensures that the test body doesn't accidentally make use of an inherited effect. -pub fun effectful-test(name: string, f: () -> (), ?kk-file: string, ?kk-line: int): >|e> () +pub fun effectful-test(name: string, f: () -> (), ?kk-file: string, ?kk-line: int): >> () register-test(Test-identity(gen-test-id(), current-scope, name, Location(?kk-file, ?kk-line)), f) pub fun test(name: string, f: () -> (), ?kk-file: string, ?kk-line: int): test () @@ -185,7 +185,7 @@ pub fun prop-test( count: int = default-sample-count, ?kk-file: string, ?kk-line: int -): >,io> () +): >> () fun run() val seed-value = next-seed() with pseudo-random(seed-value)