Switch avatar resize to ApproxBiLinear, cap hunt/profile/admin list queries, drop redundant admin/profile lookups, dedupe CI on app PRs, and refresh stale todo.md notes.
24 lines
468 B
Go
24 lines
468 B
Go
package store
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestNormalizeUsername(t *testing.T) {
|
|
if got := NormalizeUsername(" Alice_1 "); got != "alice_1" {
|
|
t.Fatalf("got %q", got)
|
|
}
|
|
}
|
|
|
|
func TestPostgresDSNDefaultsSSLMode(t *testing.T) {
|
|
in := "postgresql://user:pass@db.example.com:5432/postgres"
|
|
out, err := postgresDSN(in)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if !strings.Contains(out, "sslmode=verify-full") {
|
|
t.Fatalf("missing default sslmode: %s", out)
|
|
}
|
|
}
|