Initial commit of Descrybe v2 without local scratch artifacts.

Drop one-shot tmp/axe scripts and agent i18n scratch so the Gitea tree is deployable.
This commit is contained in:
2026-08-09 22:47:43 +02:00
commit 8580c996c3
1285 changed files with 325780 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
package woocommerce
import (
"errors"
"testing"
)
func TestNormalizeStoreURLHTTPS(t *testing.T) {
got, err := NormalizeStoreURL("https://example.com/shop/")
if err != nil {
t.Fatal(err)
}
if got != "https://example.com/shop" {
t.Fatalf("got %q", got)
}
}
func TestNormalizeStoreURLBlocksPrivateIP(t *testing.T) {
_, err := NormalizeStoreURL("https://192.168.1.10")
if !errors.Is(err, ErrBlockedStoreURL) {
t.Fatalf("expected blocked, got %v", err)
}
}
func TestNormalizeStoreURLRejectsPlainHTTPRemote(t *testing.T) {
_, err := NormalizeStoreURL("http://example.com")
if err == nil {
t.Fatal("expected error")
}
}
func TestNormalizeStoreURLAllowsLocalhostHTTP(t *testing.T) {
got, err := NormalizeStoreURL("http://127.0.0.1:8080")
if err != nil {
t.Fatal(err)
}
if got != "http://127.0.0.1:8080" {
t.Fatalf("got %q", got)
}
}