package award

import "testing"

// The three classes an operator thinks in — the ones the awards filter offers.
//
// "Which entities have I worked on CW but not confirmed" is the question this
// serves, so the classes must match how the question is asked: CW, phone, data.
// Which data mode it was does not enter into it.
func TestModeClass(t *testing.T) {
	for _, c := range []struct{ mode, want string }{
		{"CW", "CW"}, {"cw", "CW"}, {" CW ", "CW"}, {"CWR", "CW"},
		{"SSB", "PHONE"}, {"USB", "PHONE"}, {"LSB", "PHONE"},
		{"AM", "PHONE"}, {"FM", "PHONE"}, {"DV", "PHONE"},
		{"FT8", "DIGI"}, {"FT4", "DIGI"}, {"RTTY", "DIGI"}, {"PSK31", "DIGI"},
		{"JS8", "DIGI"}, {"Q65", "DIGI"}, {"OLIVIA", "DIGI"},
		// A mode nobody has heard of yet is data, not nothing: the alternative
		// is a new digital mode silently vanishing from the filter the day it
		// appears.
		{"SOMETHINGNEW", "DIGI"},
		// No mode at all is not a class, and must not be counted as one.
		{"", ""}, {"   ", ""},
	} {
		if got := ModeClass(c.mode); got != c.want {
			t.Errorf("ModeClass(%q) = %q, want %q", c.mode, got, c.want)
		}
	}
}
