This commit is contained in:
2026-06-07 12:50:04 +02:00
parent eb64b8f2f9
commit 9189f54df5
7 changed files with 126 additions and 9 deletions
+21
View File
@@ -0,0 +1,21 @@
package lookup
import "testing"
func TestHomeCall(t *testing.T) {
cases := map[string]string{
"JW/OR1A": "OR1A", // portable prefix → home call
"DL/F4NIE": "F4NIE", // prefix/home
"F4BPO/P": "F4BPO", // suffix dropped
"F4BPO/9": "F4BPO", // call-area digit dropped
"VP8/F4BPO": "F4BPO", // both have digits → longest wins
"MM/KA9P": "KA9P", // Scotland prefix + US home
"OH2BH": "OH2BH", // no slash → unchanged
"3D2/RW3RN": "RW3RN",
}
for in, want := range cases {
if got := homeCall(in); got != want {
t.Errorf("homeCall(%q) = %q, want %q", in, got, want)
}
}
}