mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-10-29 03:06:10 +08:00
49 lines
966 B
Plaintext
49 lines
966 B
Plaintext
#exe {
|
|
-Mroot=main.zig
|
|
#}
|
|
|
|
#write main.zig {
|
|
pub fn main() !void {
|
|
_ = @import("foo.zig");
|
|
try std.Io.File.stdout().writeStreamingAll(io, "success\n");
|
|
}
|
|
const std = @import("std");
|
|
const io = std.Io.Threaded.global_single_threaded.io();
|
|
#}
|
|
#write foo.zig {
|
|
comptime {
|
|
_ = @import("bad.zig");
|
|
}
|
|
#}
|
|
#update
|
|
#check errors {
|
|
bad.zig:1:1: error: unable to load "bad.zig": FileNotFound
|
|
foo.zig:2:17: note: file imported here
|
|
#}
|
|
|
|
#write foo.zig {
|
|
comptime {
|
|
_ = @import("this_is/not_real.zig");
|
|
}
|
|
#}
|
|
#update {
|
|
change bad import#}
|
|
#check errors {
|
|
this_is/not_real.zig:1:1: error: unable to load "not_real.zig": FileNotFound
|
|
foo.zig:2:17: note: file imported here
|
|
#}
|
|
|
|
#write main.zig {
|
|
pub fn main() !void {
|
|
//_ = @import("foo.zig");
|
|
try std.Io.File.stdout().writeStreamingAll(io, "success\n");
|
|
}
|
|
const std = @import("std");
|
|
const io = std.Io.Threaded.global_single_threaded.io();
|
|
#}
|
|
#update {
|
|
remove import of 'foo.zig'#}
|
|
#check stdout {
|
|
success
|
|
#}
|