✗
Failing This test is currently failing.
Failed: backend-exec
Error Details
output_emitted.zig:102:57: error: type '[]const u8' does not support struct initialization syntax
Failure Output
Showing last 10 of 11 lines
Error: output_emitted.zig:102:57: error: type '[]const u8' does not support struct initialization syntax
return .{ .@"transformed" = "HELLO WORLD" };
^~~~~~~~~~~~~
referenced by:
flow0: output_emitted.zig:53:98
main: output_emitted.zig:211:22
4 reference(s) hidden; use '-freference-trace=6' to see all references
output_emitted.zig:169:52: error: type '[][]const u8' does not support struct initialization syntax
return .{ .@"parsed" = empty };
^~~~~ Code
// Test 831: File processor (realistic I/O pattern with directory imports)
//
// Common pattern: read file -> process lines -> transform -> write output
// Tests: directory imports, multiple modules from same package, error handling
const std = @import("std");
// Import directory 'lib/io' containing:
// - file.kz (read, write events)
// - parse.kz (lines event)
// - transform.kz (uppercase event)
~import app/lib/io
// The full pipeline using directory imports
~app/lib/io/file:read(path: "input.txt")
| success s |> app/lib/io/parse:lines(text: s)
| parsed _ |> app/lib/io/transform:uppercase(text: s)
| transformed t |> app/lib/io/file:write(path: "output.txt", data: t)
| written _ |> _
| ioerror _ |> _
| notfound _ |> _
| ioerror _ |> _
Expected output
read input.txt
parse lines (11 chars)
uppercase (11 chars)
write output.txt (11 bytes)
Flows
flow ~read click a branch to expand · @labels scroll to their anchor
read (path: "input.txt")
Imported Files
// File I/O module
const std = @import("std");
~pub tor read { path: string }
| success string
| notfound string
| ioerror string
~pub tor write { path: string, data: string }
| written i32
| ioerror string
~proc read|zig {
std.debug.print("read {s}\n", .{path});
return .{ .@"success" = "hello world" };
}
~proc write|zig {
std.debug.print("write {s} ({} bytes)\n", .{ path, data.len });
return .{ .@"written" = @intCast(data.len) };
}
// Parse module
const std = @import("std");
~pub tor lines { text: string } -> [][]const u8
~proc lines|zig {
std.debug.print("parse lines ({} chars)\n", .{text.len});
const empty: [][]const u8 = &.{};
return .{ .@"parsed" = empty };
}
// Transform module
const std = @import("std");
~pub tor uppercase { text: string } -> string
~proc uppercase|zig {
std.debug.print("uppercase ({} chars)\n", .{text.len});
return .{ .@"transformed" = "HELLO WORLD" };
}
Test Configuration
MUST_RUN