package cluster

import "testing"

func TestSOTARefFrom(t *testing.T) {
	// Left column: real comments seen on the SOTA cluster feed.
	cases := []struct{ in, want string }{
		{"W9/WI-001", "W9/WI-001"},
		{"DM/BM-063", "DM/BM-063"},
		{"W7Y/TT-122", "W7Y/TT-122"},
		{"VK3/VC-014 s2s", "VK3/VC-014"},
		{"[SOTA] F/AM-123 cq", "F/AM-123"},
		{"", ""},
		// The other reference schemes that share this field.
		{"POTA US-4475", ""},
		{"WWFF DLFF-0001", ""},
		// A portable callsign is not a summit.
		{"DL/SP9DPM/P calling", ""},
	}
	for _, c := range cases {
		if got := SOTARefFrom(c.in); got != c.want {
			t.Errorf("SOTARefFrom(%q) = %q, want %q", c.in, got, c.want)
		}
	}
}
