package restriction

import (
	"context"
	"testing"

	"github.com/duke-git/lancet/v2/maputil"
)

func TestGetLocationByIP(t *testing.T) {
	ctx := context.Background()
	response, err := GetLocationByIP(ctx, "123.123.123.123")
	t.Log(response, err)
}

func TestEachClient(t *testing.T) {
	ctx := context.Background()
	maputil.ForEach(implementations, func(key ConstsImpl, value func() Location) {
		t.Log(key)
		resp, err := implementations[key]().QueryLocationByIP(ctx, "123.123.123.123")
		t.Log(resp, err)
	})
}
