chore: release v0.21.3
This commit is contained in:
@@ -19,3 +19,44 @@ func TestHomeCall(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Mobile and maritime-mobile suffixes: /M is the case that surfaced in the field
|
||||
// (F4LYI/M resolved only to cty.dat while F4LYI resolved on QRZ), so pin the
|
||||
// whole suffix family — the home call is what the provider record is filed under.
|
||||
func TestHomeCallSuffixes(t *testing.T) {
|
||||
for call, want := range map[string]string{
|
||||
"F4LYI/M": "F4LYI",
|
||||
"F4LYI/MM": "F4LYI",
|
||||
"F4LYI/AM": "F4LYI",
|
||||
"F4LYI/QRP": "F4LYI",
|
||||
"F4LYI/A": "F4LYI",
|
||||
"F4LYI/B": "F4LYI",
|
||||
} {
|
||||
if got := homeCall(call); got != want {
|
||||
t.Errorf("homeCall(%q) = %q, want %q", call, got, want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Operational suffixes must resolve to the bare call WITHOUT a provider query on
|
||||
// the slashed form; entity- and area-changing forms must not be stripped.
|
||||
func TestStripOpSuffix(t *testing.T) {
|
||||
strip := map[string]string{
|
||||
"F4LYI/M": "F4LYI", "F4LYI/MM": "F4LYI", "F4LYI/AM": "F4LYI",
|
||||
"F4LYI/P": "F4LYI", "F4LYI/QRP": "F4LYI", "F4LYI/p": "F4LYI",
|
||||
"F4BPO/M/P": "F4BPO",
|
||||
}
|
||||
for call, want := range strip {
|
||||
got, ok := stripOpSuffix(call)
|
||||
if !ok || got != want {
|
||||
t.Errorf("stripOpSuffix(%q) = %q,%v — want %q,true", call, got, ok, want)
|
||||
}
|
||||
}
|
||||
// These change the entity or the call area: they are real, separately
|
||||
// registered forms and must be queried exactly as entered.
|
||||
for _, call := range []string{"JW/OR1A", "VP8/F4BPO", "F4BPO/8", "DL/F4NIE", "OH2BH", "F4BPO/W6"} {
|
||||
if got, ok := stripOpSuffix(call); ok {
|
||||
t.Errorf("stripOpSuffix(%q) stripped to %q — it changes entity/area and must be kept", call, got)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user