🎨 Format domains code
This commit is contained in:
parent
1d14c7a347
commit
e2f33be718
|
@ -10,7 +10,7 @@ import (
|
|||
)
|
||||
|
||||
//nolint: funlen
|
||||
func TestClientID(t *testing.T) {
|
||||
func TestNewClientID(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
for _, testCase := range []struct {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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",
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package domain
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
type User struct {
|
||||
Me *Me
|
||||
|
|
Loading…
Reference in New Issue