#zig build-exe {
--name test
--dep foo -Mroot=test.zig
-Mfoo=foo.zig
#}

#write test.zig {
const std = @import("std");
const io = std.Io.Threaded.global_single_threaded.io();
pub fn main() !void {
    try std.Io.File.stdout().writeStreamingAll(io, "main()\n");
}
#}
#write foo.zig {
const std = @import("std");
const io = std.Io.Threaded.global_single_threaded.io();
pub fn bar() !void {
    try std.Io.File.stdout().writeStreamingAll(io, "bar()\n");
}
#}
#update "not imported"
#check stdout {
main()
#}

#write test.zig {
const std = @import("std");
const io = std.Io.Threaded.global_single_threaded.io();
pub fn main() !void {
    try std.Io.File.stdout().writeStreamingAll(io, "main()\n");
}
const foo = @import("foo");
#}
#update "not analyzed"
#check stdout {
main()
#}

#write test.zig {
const std = @import("std");
const io = std.Io.Threaded.global_single_threaded.io();
pub fn main() !void {
    try std.Io.File.stdout().writeStreamingAll(io, "main()\n");
    try foo.bar();
}
const foo = @import("foo");
#}
#update "alive"
#check stdout {
main()
bar()
#}
