up
This commit is contained in:
@@ -83,6 +83,19 @@ func TestNatLess(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// A multi-reference field (n-fer POTA) counts each park separately.
|
||||
func TestComputeMultiRef(t *testing.T) {
|
||||
def := Def{Code: "POTA", Type: TypeReference, Field: "pota_ref", Dynamic: true, Confirm: []string{"lotw", "qsl"}, Valid: true}
|
||||
qsos := []qso.QSO{
|
||||
{Callsign: "W2QMI", Band: "20m", POTARef: "US-6544,US-0680", LOTWRcvd: "Y"},
|
||||
{Callsign: "K1ABC", Band: "40m", POTARef: "US-0680"}, // shared park
|
||||
}
|
||||
r := Compute([]Def{def}, qsos, nil, nil)[0]
|
||||
if r.Worked != 2 { // distinct parks: US-6544, US-0680
|
||||
t.Errorf("POTA worked = %d, want 2 (%v)", r.Worked, refCodes(r))
|
||||
}
|
||||
}
|
||||
|
||||
func refCodes(r Result) []string {
|
||||
out := make([]string, 0, len(r.Refs))
|
||||
for _, rf := range r.Refs {
|
||||
|
||||
Reference in New Issue
Block a user