007 dir import basic

✓ Passing This code compiles and runs correctly.

Code

// Test 833: Basic directory import
//
// Tests importing a directory containing multiple .kz files
// Directory import creates two-level namespace: package.module:event()

const std = @import("std");

// Import directory 'lib/raylib' containing graphics.kz and audio.kz
// With canonical naming, events are fully qualified:
// - app.lib.raylib.graphics:render()
// - app.lib.raylib.graphics:clear()
// - app.lib.raylib.audio:play()
// - app.lib.raylib.audio:stop()
~import "$app/lib/raylib"

// Test using directory imports with full canonical paths
~app.lib.raylib.graphics:render(width: 1920, height: 1080)
| drawn _ |> app.lib.raylib.graphics:clear(color: 0xFF0000)
    | cleared |> app.lib.raylib.audio:play(sound_id: 42)
        | playing |> app.lib.raylib.audio:stop()
            | stopped |> _
input.kz

Imported Files

// Audio module for raylib

const std = @import("std");

~pub event play { sound_id: i32 }
| playing {}

~pub event stop {}
| stopped {}

~proc play {
    return .{ .@"playing" = .{} };
}

~proc stop {
    return .{ .@"stopped" = .{} };
}
lib/raylib/audio.kz
// Graphics module for raylib

const std = @import("std");

~pub event render { width: i32, height: i32 }
| drawn { pixels: i32 }

~pub event clear { color: i32 }
| cleared {}

~proc render {
    return .{ .@"drawn" = .{ .pixels = width * height } };
}

~proc clear {
    return .{ .@"cleared" = .{} };
}
lib/raylib/graphics.kz

Test Configuration

Expected Behavior:

SUCCESS