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) } } }