Extraction of other resource mappings

This commit is contained in:
2026-05-20 19:27:27 +02:00
parent 4c8faf40ec
commit b1b7a08848
3 changed files with 112 additions and 10 deletions
+31
View File
@@ -97,3 +97,34 @@ func TestExtensionMappingsSupportModernAssetTypes(t *testing.T) {
}
}
}
func TestExtensionMappingsSupportAllUTBlueprintTypes(t *testing.T) {
cases := map[string]uint16{
"uti": 0x07E9,
"utc": 0x07EB,
"utt": 0x07F0,
"uts": 0x07F3,
"ute": 0x07F8,
"utd": 0x07FA,
"utp": 0x07FC,
"utm": 0x0803,
"utg": 0x0807,
"utw": 0x080A,
}
for ext, wantType := range cases {
gotType, ok := ResourceTypeForExtension(ext)
if !ok {
t.Fatalf("expected %s to resolve to a resource type", ext)
}
if gotType != wantType {
t.Fatalf("expected %s type 0x%04X, got 0x%04X", ext, wantType, gotType)
}
gotExt, ok := ExtensionForResourceType(wantType)
if !ok {
t.Fatalf("expected type 0x%04X to resolve back to an extension", wantType)
}
if gotExt != ext {
t.Fatalf("expected type 0x%04X to resolve to %s, got %s", wantType, ext, gotExt)
}
}
}