diff --git a/internal/domain/client_id_test.go b/internal/domain/client_id_test.go index 08a6aa4..08c85eb 100644 --- a/internal/domain/client_id_test.go +++ b/internal/domain/client_id_test.go @@ -10,7 +10,7 @@ import ( ) //nolint: funlen -func TestClientID(t *testing.T) { +func TestNewClientID(t *testing.T) { t.Parallel() for _, testCase := range []struct { diff --git a/internal/domain/error.go b/internal/domain/error.go index 77812f0..89f9f19 100644 --- a/internal/domain/error.go +++ b/internal/domain/error.go @@ -27,7 +27,7 @@ func (e Error) FormatError(p xerrors.Printer) error { p.Print(e.Description) if e.URI != "" { - p.Print(": ", e.URI, "\n") + p.Print(" (", e.URI, ")") } if !p.Detail() { diff --git a/internal/domain/me_test.go b/internal/domain/me_test.go index 27e9f4f..4f22dad 100644 --- a/internal/domain/me_test.go +++ b/internal/domain/me_test.go @@ -9,7 +9,8 @@ import ( "source.toby3d.me/website/indieauth/internal/domain" ) -func TestMe(t *testing.T) { +//nolint: funlen +func TestNewMe(t *testing.T) { t.Parallel() for _, testCase := range []struct { diff --git a/internal/domain/ticket.go b/internal/domain/ticket.go index 69043bc..c3a43d8 100644 --- a/internal/domain/ticket.go +++ b/internal/domain/ticket.go @@ -12,7 +12,7 @@ type Ticket struct { Resource *URL // The access token should be used when acting on behalf of this URL. - Subject *Me + Subject *URL } func TestTicket(tb testing.TB) *Ticket { @@ -20,7 +20,7 @@ func TestTicket(tb testing.TB) *Ticket { return &Ticket{ Resource: TestURL(tb, "https://alice.example.com/private/"), - Subject: TestMe(tb), + Subject: TestURL(tb, "https://bob.example.com/"), Ticket: "32985723984723985792834", } } diff --git a/internal/domain/token.go b/internal/domain/token.go index 5a7648d..0d9d928 100644 --- a/internal/domain/token.go +++ b/internal/domain/token.go @@ -90,10 +90,10 @@ func TestToken(tb testing.TB) *Token { cid := TestClientID(tb) me := TestMe(tb) now := time.Now().UTC().Round(time.Second) - scope := []Scope{ + scope := Scopes{ ScopeCreate, - ScopeUpdate, ScopeDelete, + ScopeUpdate, } // NOTE(toby3d): required diff --git a/internal/domain/user.go b/internal/domain/user.go index 9f38781..bb5cc5e 100644 --- a/internal/domain/user.go +++ b/internal/domain/user.go @@ -1,6 +1,8 @@ package domain -import "testing" +import ( + "testing" +) type User struct { Me *Me