country-geo-locations/pkg/geoloc/static_test.go
Tom Neuber 8215e1f13a
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/deploy Pipeline was successful
refactor: restructure project
2024-11-26 13:35:54 +01:00

28 lines
551 B
Go

package geoloc_test
import (
"reflect"
"testing"
"git.ar21.de/yolokube/country-geo-locations/pkg/geoloc"
)
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 := geoloc.CalculateIPNum(tt.args.input); err != nil || !reflect.DeepEqual(got, tt.want) {
t.Errorf("GetIPInfo() - %v, want %v", got, tt.want)
}
})
}
}