mirror of
https://github.com/ziglang/zig.git
synced 2024-11-26 23:22:44 +00:00
19 lines
387 B
Zig
19 lines
387 B
Zig
const std = @import("std");
|
|
const expect = std.testing.expect;
|
|
|
|
test "turn HashMap into a set with void" {
|
|
var map = std.AutoHashMap(i32, void).init(std.testing.allocator);
|
|
defer map.deinit();
|
|
|
|
try map.put(1, {});
|
|
try map.put(2, {});
|
|
|
|
try expect(map.contains(2));
|
|
try expect(!map.contains(3));
|
|
|
|
_ = map.remove(2);
|
|
try expect(!map.contains(2));
|
|
}
|
|
|
|
// test
|