std.StringHashMap.zig

Working version(s):
0.13.0

Failing version(s):
0.14.10.15.20.16.0-dev.2637+6a9510c0e

Code

// from https://zig.guide/standard-library/hashmaps
// license: https://github.com/sobeston/zig.guide?tab=MIT-1-ov-file#readme
const std = @import("std");

test "string hashmap" {
    var map = std.StringHashMap(enum { cool, uncool }).init(std.testing.allocator);
    defer map.deinit();

    try map.put("loris", .uncool);
    try map.put("me", .cool);

    try std.testing.expect(map.get("me").? == .cool);
    try std.testing.expect(map.get("loris").? == .uncool);
}