🎨 Format domains code

This commit is contained in:
Maxim Lebedev 2022-01-08 15:53:58 +05:00
parent 1d14c7a347
commit e2f33be718
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
6 changed files with 11 additions and 8 deletions

View File

@ -10,7 +10,7 @@ import (
)
//nolint: funlen
func TestClientID(t *testing.T) {
func TestNewClientID(t *testing.T) {
t.Parallel()
for _, testCase := range []struct {

View File

@ -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() {

View File

@ -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 {

View File

@ -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",
}
}

View File

@ -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

View File

@ -1,6 +1,8 @@
package domain
import "testing"
import (
"testing"
)
type User struct {
Me *Me