009 cross module mock

✓ Passing This code compiles and runs correctly.

Code

input.k

Flows

subflow ~process-config click a branch to expand · @labels scroll to their anchor
read-lines (path)
flow ~test click a branch to expand · @labels scroll to their anchor
test (Cross-module mock with failed branch, source: // Mock the external module's event with the 'failed' branch // This returns a simple string ([]const u8), which works without array literals std/fs:read-lines => failed "mocked file read error" process-config(path: "/this/file/does/not/exist.txt") | ok _ |> assert.fail() | failed result |> assert(result.len > 0))
flow ~test click a branch to expand · @labels scroll to their anchor
test (Cross-module mock should return 3 lines, source: std/fs:read-lines => done 3 process-config(path: "/fake/path") | ok result |> assert(result == 3) | failed |> assert.fail())

Test Configuration

Post-validation Script: