package provider

import (
	"context"
	"testing"
)

func TestValidateBaseURLBlocksPrivateLiteral(t *testing.T) {
	if _, err := ValidateBaseURL(context.Background(), "http://127.0.0.1:8080/v1", false); err == nil {
		t.Fatal("expected loopback URL to be blocked")
	}
	got, err := ValidateBaseURL(context.Background(), "http://127.0.0.1:8080/v1/", true)
	if err != nil || got != "http://127.0.0.1:8080/v1" {
		t.Fatalf("unexpected private URL result %q: %v", got, err)
	}
}
