🎨 Format domains code
This commit is contained in:
parent
1d14c7a347
commit
e2f33be718
|
@ -10,7 +10,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
//nolint: funlen
|
//nolint: funlen
|
||||||
func TestClientID(t *testing.T) {
|
func TestNewClientID(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
for _, testCase := range []struct {
|
for _, testCase := range []struct {
|
||||||
|
|
|
@ -27,7 +27,7 @@ func (e Error) FormatError(p xerrors.Printer) error {
|
||||||
p.Print(e.Description)
|
p.Print(e.Description)
|
||||||
|
|
||||||
if e.URI != "" {
|
if e.URI != "" {
|
||||||
p.Print(": ", e.URI, "\n")
|
p.Print(" (", e.URI, ")")
|
||||||
}
|
}
|
||||||
|
|
||||||
if !p.Detail() {
|
if !p.Detail() {
|
||||||
|
|
|
@ -9,7 +9,8 @@ import (
|
||||||
"source.toby3d.me/website/indieauth/internal/domain"
|
"source.toby3d.me/website/indieauth/internal/domain"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestMe(t *testing.T) {
|
//nolint: funlen
|
||||||
|
func TestNewMe(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
for _, testCase := range []struct {
|
for _, testCase := range []struct {
|
||||||
|
|
|
@ -12,7 +12,7 @@ type Ticket struct {
|
||||||
Resource *URL
|
Resource *URL
|
||||||
|
|
||||||
// The access token should be used when acting on behalf of this URL.
|
// The access token should be used when acting on behalf of this URL.
|
||||||
Subject *Me
|
Subject *URL
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestTicket(tb testing.TB) *Ticket {
|
func TestTicket(tb testing.TB) *Ticket {
|
||||||
|
@ -20,7 +20,7 @@ func TestTicket(tb testing.TB) *Ticket {
|
||||||
|
|
||||||
return &Ticket{
|
return &Ticket{
|
||||||
Resource: TestURL(tb, "https://alice.example.com/private/"),
|
Resource: TestURL(tb, "https://alice.example.com/private/"),
|
||||||
Subject: TestMe(tb),
|
Subject: TestURL(tb, "https://bob.example.com/"),
|
||||||
Ticket: "32985723984723985792834",
|
Ticket: "32985723984723985792834",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,10 +90,10 @@ func TestToken(tb testing.TB) *Token {
|
||||||
cid := TestClientID(tb)
|
cid := TestClientID(tb)
|
||||||
me := TestMe(tb)
|
me := TestMe(tb)
|
||||||
now := time.Now().UTC().Round(time.Second)
|
now := time.Now().UTC().Round(time.Second)
|
||||||
scope := []Scope{
|
scope := Scopes{
|
||||||
ScopeCreate,
|
ScopeCreate,
|
||||||
ScopeUpdate,
|
|
||||||
ScopeDelete,
|
ScopeDelete,
|
||||||
|
ScopeUpdate,
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE(toby3d): required
|
// NOTE(toby3d): required
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package domain
|
package domain
|
||||||
|
|
||||||
import "testing"
|
import (
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
type User struct {
|
type User struct {
|
||||||
Me *Me
|
Me *Me
|
||||||
|
|
Loading…
Reference in New Issue