diff options
| author | Laytan Laats <laytanlaats@hotmail.com> | 2024-07-29 02:21:26 +0200 |
|---|---|---|
| committer | Laytan Laats <laytanlaats@hotmail.com> | 2024-07-29 02:32:13 +0200 |
| commit | 4d1d754caeb421da9a289fee613aea16867f14ce (patch) | |
| tree | 61844c9acfd42ce0c72b0b8f0b26b61eba7b7a03 /tests | |
| parent | 24e6f16f4aa574b182e4ec2361b22b4c3d71e34c (diff) | |
fix `specific_union_variant in map_keyed_by_union` not converting to union type
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/internal/test_map.odin | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/internal/test_map.odin b/tests/internal/test_map.odin index 9bd5d34ea..4d305024e 100644 --- a/tests/internal/test_map.odin +++ b/tests/internal/test_map.odin @@ -317,3 +317,23 @@ set_delete_random_key_value :: proc(t: ^testing.T) { seed_incr += 1 } } + +@test +test_union_key_should_not_be_hashing_specifc_variant :: proc(t: ^testing.T) { + Vec2 :: [2]f32 + BoneId :: distinct int + VertexId :: distinct int + Id :: union { + BoneId, + VertexId, + } + + m: map[Id]Vec2 + defer delete(m) + + bone_1: BoneId = 69 + m[bone_1] = {4, 20} + + testing.expect_value(t, bone_1 in m, true) + testing.expect_value(t, Id(bone_1) in m, true) +} |