Files
zig/test/incremental/bad_import
T
Andrew Kelley 80625990d5 std: different mechanism for disabling network dependency
On Windows, it is sometimes problematic to depend on ws2_32.dll. Before,
users of std.Io.Threaded would have to call ioBasic() rather than io()
in order to avoid unnecessary dependencies on ws2_32.dll. Now, the
application can disable networking with std.Options.

This change is necessary due to moving networking functionality to
be based on Io.Operation, which is a tagged union.
2026-03-08 19:20:34 -07:00

39 lines
1.1 KiB
Plaintext

#target=x86_64-linux-selfhosted
#target=x86_64-windows-selfhosted
#target=x86_64-linux-cbe
#target=x86_64-windows-cbe
#target=wasm32-wasi-selfhosted
#update=initial version
#file=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();
#file=foo.zig
comptime {
_ = @import("bad.zig");
}
#expect_error=bad.zig:1:1: error: unable to load 'bad.zig': FileNotFound
#expect_error=foo.zig:2:17: note: file imported here
#update=change bad import
#file=foo.zig
comptime {
_ = @import("this_is/not_real.zig");
}
#expect_error=this_is/not_real.zig:1:1: error: unable to load 'not_real.zig': FileNotFound
#expect_error=foo.zig:2:17: note: file imported here
#update=remove import of 'foo.zig'
#file=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();
#expect_stdout="success\n"