2023-12-13 17:42:17 +01:00
|
|
|
package geoloc
|
|
|
|
|
|
|
|
import (
|
|
|
|
"reflect"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
2023-12-19 13:56:03 +01:00
|
|
|
func TestGetIPInfo(t *testing.T) {
|
|
|
|
type args struct {
|
|
|
|
input string
|
|
|
|
}
|
|
|
|
tests := []struct {
|
|
|
|
name string
|
|
|
|
args args
|
|
|
|
want uint
|
|
|
|
}{
|
|
|
|
{"IP address Test", args{input: "1.1.1.1"}, 16843008},
|
|
|
|
}
|
|
|
|
for _, tt := range tests {
|
|
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
|
|
if got, err := GetIPInfo(tt.args.input); err != nil || !reflect.DeepEqual(got, tt.want) {
|
|
|
|
t.Errorf("GetIPInfo() - %v, want %v", got, tt.want)
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|