authorgravatar for suirad@users.noreply.github.comSuirad <suirad@users.noreply.github.com> 2018-11-30 02:15:33-06:00
committergravatar for suirad@users.noreply.github.comSuirad <suirad@users.noreply.github.com> 2018-11-30 02:15:33-06:00
logcf266ff80a69d19140465b949350421dc541d4c8
tree1bfd6b7b257bad8e77d4917e53c17ab56cce15a2
parente8e6ae57d41fdcdb4027ae95c04ad7aeea4a7aac

Update tests


1 files changed, 3 insertions(+), 28 deletions(-)

std/os/index.zig+3-28
......@@ -772,27 +772,7 @@ pub fn getEnvMap(allocator: *Allocator) !BufMap {
772772
773773test "os.getEnvMap" {
774774 var env = try getEnvMap(std.debug.global_allocator);
775 var seen_home = false;
776 var it = env.iterator();
777 while (it.next()) |pair| {
778 debug.warn("{}: {}\n", pair.key, pair.value);
779 switch (builtin.os){
780 builtin.Os.windows => {
781 if (mem.eql(u8, pair.key, "HOMEPATH")) {
782 seen_home = true;
783 }
784 },
785 builtin.Os.linux, builtin.Os.macosx,
786 builtin.Os.ios => {
787 if (mem.eql(u8, pair.key, "HOME")) {
788 seen_home = true;
789 }
790 },
791 else => @compileError("unimplemented"),
792 }
793 }
794
795 assert(seen_home == true);
775 defer env.deinit();
796776}
797777
798778/// TODO make this go through libc when we have it
......@@ -862,13 +842,8 @@ pub fn getEnvVarOwned(allocator: *mem.Allocator, key: []const u8) GetEnvVarOwned
862842}
863843
864844test "os.getEnvVarOwned" {
865 switch (builtin.os) {
866 builtin.Os.windows => _ = try getEnvVarOwned(debug.global_allocator, "HOMEPATH"),
867
868 builtin.Os.linux, builtin.Os.macosx,
869 builtin.Os.ios => _ = try getEnvVarOwned(debug.global_allocator, "HOME"),
870 else => @compileError("unimplemented"),
871 }
845 var ga = debug.global_allocator;
846 debug.assertError(getEnvVarOwned(ga, "BADENV"), error.EnvironmentVariableNotFound);
872847}
873848
874849