You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
FLEcli/cmd/callsign_test.go

31 lines
728 B

package cmd
import "testing"
func TestValidateCall(t *testing.T) {
type args struct {
sign string
}
tests := []struct {
name string
args args
//args string
wantCall string
wantErrorMsg string
}{
{"Good call (simple)", args.String("on4kjm"), "ON4KJM", ""},
{"Good call (suffix)", "on4kjm/p", "ON4KJM/P", ""},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
gotCall, gotErrorMsg := ValidateCall(tt.args.sign)
if gotCall != tt.wantCall {
t.Errorf("ValidateCall() gotCall = %v, want %v", gotCall, tt.wantCall)
}
if gotErrorMsg != tt.wantErrorMsg {
t.Errorf("ValidateCall() gotErrorMsg = %v, want %v", gotErrorMsg, tt.wantErrorMsg)
}
})
}
}