23 lines
482 B
Go
23 lines
482 B
Go
package authentik
|
|
|
|
import "testing"
|
|
|
|
func TestJoinRedirectURIsDedupes(t *testing.T) {
|
|
got := joinRedirectURIs([]string{
|
|
"http://localhost/a",
|
|
"http://localhost/a",
|
|
"http://localhost/b",
|
|
})
|
|
want := "http://localhost/a\nhttp://localhost/b"
|
|
if got != want {
|
|
t.Fatalf("got %q want %q", got, want)
|
|
}
|
|
}
|
|
|
|
func TestUniqueURIs(t *testing.T) {
|
|
uris := uniqueURIs("", "http://a", "http://a", "http://b")
|
|
if len(uris) != 2 {
|
|
t.Fatalf("expected 2 uris, got %d", len(uris))
|
|
}
|
|
}
|