@ -32,22 +32,22 @@ func TestValidateWwff(t *testing.T) {
{
"Bad ref (no country prefix)" ,
args { inputStr : "ff-0258" } ,
"*FF-0258" , " I nvalid WWFF reference",
"*FF-0258" , " [FF-0258] is an i nvalid WWFF reference",
} ,
{
"Bad ref (wrong separator)" ,
args { inputStr : "gff/0258" } ,
"*GFF/0258" , " I nvalid WWFF reference",
"*GFF/0258" , " [GFF/0258] is an i nvalid WWFF reference",
} ,
{
"Bad ref (reference too short)" ,
args { inputStr : "onff-258" } ,
"*ONFF-258" , " I nvalid WWFF reference",
"*ONFF-258" , " [ONFF-258] is an i nvalid WWFF reference",
} ,
{
"Bad ref (no country prefix)" ,
args { inputStr : "onff-02589" } ,
"*ONFF-02589" , " I nvalid WWFF reference",
"*ONFF-02589" , " [ONFF-02589] is an i nvalid WWFF reference",
} ,
}
for _ , tt := range tests {
@ -96,37 +96,37 @@ func TestValidateSota(t *testing.T) {
{
"Bad ref (long prefix)" ,
args { inputStr : "xxxx/ON-001" } ,
"*XXXX/ON-001" , " I nvalid SOTA reference",
"*XXXX/ON-001" , " [XXXX/ON-001] is an i nvalid SOTA reference",
} ,
{
"Bad ref (missing slash)" ,
args { inputStr : "on ON-001" } ,
"*ON ON-001" , " I nvalid SOTA reference",
"*ON ON-001" , " [ON ON-001] is an i nvalid SOTA reference",
} ,
{
"Bad ref (numerical region)" ,
args { inputStr : "on/9N-001" } ,
"*ON/9N-001" , " I nvalid SOTA reference",
"*ON/9N-001" , " [ON/9N-001] is an i nvalid SOTA reference",
} ,
{
"Bad ref (too long region)" ,
args { inputStr : "on/ONA-001" } ,
"*ON/ONA-001" , " I nvalid SOTA reference",
"*ON/ONA-001" , " [ON/ONA-001] is an i nvalid SOTA reference",
} ,
{
"Bad ref (no dash)" ,
args { inputStr : "on/ON/001" } ,
"*ON/ON/001" , " I nvalid SOTA reference",
"*ON/ON/001" , " [ON/ON/001] is an i nvalid SOTA reference",
} ,
{
"Bad ref (number too short)" ,
args { inputStr : "on/ON-01" } ,
"*ON/ON-01" , " I nvalid SOTA reference",
"*ON/ON-01" , " [ON/ON-01] is an i nvalid SOTA reference",
} ,
{
"Bad ref (Number too long)" ,
args { inputStr : "on/ON-9001" } ,
"*ON/ON-9001" , " I nvalid SOTA reference",
"*ON/ON-9001" , " [ON/ON-9001] is an i nvalid SOTA reference",
} ,
}
for _ , tt := range tests {
@ -196,32 +196,32 @@ func TestValidateCall(t *testing.T) {
{
"Pure junk passed" ,
args { sign : "aaaaaa" } ,
"*AAAAAA" , " I nvalid call",
"*AAAAAA" , " [AAAAAA] is an i nvalid call",
} ,
{
"empty string" ,
args { sign : "" } ,
"*" , " I nvalid call",
"*" , " [] is an i nvalid call",
} ,
{
"string with spaces" ,
args { sign : " " } ,
"*" , " I nvalid call",
"*" , " [] is an i nvalid call",
} ,
{
"invalid prefix" ,
args { sign : "xyz4/on4kjm" } ,
"*XYZ4/ON4KJM" , " I nvalid prefix",
"*XYZ4/ON4KJM" , " [XYZ4] is an i nvalid prefix",
} ,
{
"Too many /" ,
args { sign : "F/on4kjm/p/x" } ,
"*F/ON4KJM/P/X" , " T oo many '/'",
"*F/ON4KJM/P/X" , " [F/ON4KJM/P/X] is invalid: t oo many '/'",
} ,
{
"signe /" ,
args { sign : "/" } ,
"*/" , " I nvalid call",
"*/" , " [] is an i nvalid call",
} ,
}
for _ , tt := range tests {