fix(lookup): /QRP is about power, not about place
QRZ has no record under M0BFS/QRP, so the lookup falls back to the home call — that part worked. What followed did not: the home record's location is then discarded, on the reasoning that a portable operator is not at their registered address. True for /P and /M, and simply wrong for /QRP, which says something about the transmitter and nothing about where it is. So the grid came back empty for M0BFS/QRP while the same call without the suffix answered perfectly, which is exactly how it was reported. The distinction is now explicit rather than lumped in with the other operational suffixes. /P and /M keep clearing the location, because mobile and portable both mean somewhere other than home — that behaviour was correct and is untouched. A power suffix stacked on a portable one (F4BPO/P/QRP) still clears: one of them moved the operator.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package lookup
|
||||
|
||||
import "testing"
|
||||
|
||||
// A grid came back empty for M0BFS/QRP while the same lookup without the suffix
|
||||
// answered perfectly. The home-call pass wiped the location on the grounds that
|
||||
// a portable operator is not at their registered address — true for /P and /M,
|
||||
// and simply wrong for /QRP, which is a statement about power.
|
||||
func TestSaysNothingAboutLocation(t *testing.T) {
|
||||
keep := []string{"M0BFS/QRP", "f4bpo/qrp", "G0ABC/QRP"}
|
||||
for _, c := range keep {
|
||||
if !saysNothingAboutLocation(c) {
|
||||
t.Errorf("%s: the home location should be kept — /QRP does not move anyone", c)
|
||||
}
|
||||
}
|
||||
// These DO move the operator, or change the entity outright.
|
||||
drop := []string{"F4BPO/P", "F4BPO/M", "F4BPO/MM", "F4BPO/AM", "JW/OR1A", "VP8/F4BPO", "F4BPO/8", "F4BPO"}
|
||||
for _, c := range drop {
|
||||
if saysNothingAboutLocation(c) {
|
||||
t.Errorf("%s: the home location must NOT be trusted", c)
|
||||
}
|
||||
}
|
||||
// A power suffix on top of a portable one still moves them.
|
||||
if saysNothingAboutLocation("F4BPO/P/QRP") {
|
||||
t.Error("F4BPO/P/QRP is portable — location must not be kept")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user