Select Git revision
address_utils_test.go
address_utils_test.go 847 B
package address_utils
import (
"fmt"
"testing"
)
func TestCleanProvince(t *testing.T) {
zone := "Wes KaaP"
country := "South Africa"
cleanCountry, cleanZone := CleanZone(&country, &zone)
fmt.Printf("%s, %s converted to %s, %s\n", zone, country, *cleanZone, *cleanCountry)
}
func TestIsProvince(t *testing.T) {
type args struct {
address string
}
tests := []struct {
name string
args args
want bool
}{{
name: "IsProvince",
args: args{address: "North West, South Africa"},
want: true,
}, {
name: "IsNotProvince",
args: args{address: "22 Kruis Street, Potchefstroom, Potchefstroom, 2531, GP, ZA"},
want: false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := IsProvince(tt.args.address); got != tt.want {
t.Errorf("IsProvince() = %v, want %v", got, tt.want)
}
})
}
}