static string map

This commit is contained in:
2026-07-22 03:12:19 +02:00
parent 41c326c961
commit a4e6f96951
7 changed files with 123 additions and 9 deletions
+16
View File
@@ -7,6 +7,22 @@ TestTokenKind :: enum(u8) {
}
TestNames :: alias EnumFieldStruct(TestTokenKind, ?[]u8, some!(null))
TestArrayAlias :: alias [3]u16
hide array_info_matches func($Array, $Child type, $len usize) bool {
match typeinfo!(Array) {
.array |info|: return info.child == Child and info.len == len
else: return false
}
}
array_reflection_exposes_child_and_logical_length test {
try testing.expect($(array_info_matches([4]i32, i32, 4)))
try testing.expect($(array_info_matches([0]bool, bool, 0)))
try testing.expect($(array_info_matches(TestArrayAlias, u16, 3)))
try testing.expect($(array_info_matches([2]mut i64, i64, 2)))
try testing.expect($(array_info_matches([2;0]u8, u8, 2)))
}
enum_field_struct_defaults test {
names TestNames = {