From 8492ced0755924b3c4c0d67fb306d65bffd0933a Mon Sep 17 00:00:00 2001 From: Jonathan Marler Date: Sun, 6 Feb 2022 23:30:06 -0700 Subject: [PATCH] incorporate review changes from squeek --- lib/std/process.zig | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/std/process.zig b/lib/std/process.zig index b460264a8c..84d41972b5 100644 --- a/lib/std/process.zig +++ b/lib/std/process.zig @@ -100,7 +100,7 @@ pub const EnvMap = struct { if (upcase(c_a) != upcase(c_b)) return false; } - if (it_b.nextCodepoint()) |_| return false; + return if (it_b.nextCodepoint()) |_| false else true; } return std.hash_map.eqlString(a, b); } @@ -232,6 +232,12 @@ test "EnvMap" { try testing.expect(env.get("SOMETHING_NEW") == null); try testing.expectEqual(@as(EnvMap.Size, 1), env.count()); + + // test Unicode case-insensitivity on Windows + if (builtin.os.tag == .windows) { + try env.put("КИРиллИЦА", "something else"); + try testing.expectEqualStrings("something else", env.get("кириллица").?); + } } /// Returns a snapshot of the environment variables of the current process.