Some Cleaning

pull/2/head
Jean-Marc MEESSEN 4 years ago
parent 8443c27b18
commit ec6cb27812

@ -13,21 +13,41 @@ func TestValidateWwff(t *testing.T) {
wantErrorMsg string wantErrorMsg string
}{ }{
{ {
"Good call (simple)", "Good ref (simple)",
args{ inputStr: "onff-0258", }, args{ inputStr: "onff-0258", },
"ONFF-0258", "", "ONFF-0258", "",
}, },
{ {
"Good call (simple)", "Good ref (single digit country)",
args{ inputStr: "fff-0258", }, args{ inputStr: "fff-0258", },
"FFF-0258", "", "FFF-0258", "",
}, },
{ {
"Good call (simple)", "Good ref (Numerical country)",
args{ inputStr: "4xff-0258", }, args{ inputStr: "4xff-0258", },
"4XFF-0258", "", "4XFF-0258", "",
}, },
//TODO: add the invalid cases {
"Bad ref (no country prefix)",
args{ inputStr: "ff-0258", },
"*FF-0258", "Invalid WWFF reference",
},
{
"Bad ref (wrong separator)",
args{ inputStr: "gff/0258", },
"*GFF/0258", "Invalid WWFF reference",
},
{
"Bad ref (reference too short)",
args{ inputStr: "onff-258", },
"*ONFF-258", "Invalid WWFF reference",
},
{
"Bad ref (no country prefix)",
args{ inputStr: "onff-02589", },
"*ONFF-02589", "Invalid WWFF reference",
},
} }
for _, tt := range tests { for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {

@ -2,3 +2,4 @@
* `./FLEcli -i test/data/fle-1.txt load` * `./FLEcli -i test/data/fle-1.txt load`
* `./FLEcli -i test/sample_contest_ru.txt load` * `./FLEcli -i test/sample_contest_ru.txt load`
* `go test ./...` runs the unit tests

@ -2,6 +2,7 @@
mycall on4kjm/p mycall on4kjm/p
operator on4kjm operator on4kjm
nickname Portable nickname Portable
QslMsg This is a QSL message
# Log # Log
date 2020-05-23 date 2020-05-23

Loading…
Cancel
Save