Some formatting

This commit is contained in:
mariusor 2022-03-18 14:02:09 +01:00
parent 071af346d1
commit 4a60b3c358
No known key found for this signature in database
GPG key ID: DBF5E47F5DBC4D21
2 changed files with 26 additions and 24 deletions

View file

@ -2,11 +2,12 @@ package handlers
import ( import (
"fmt" "fmt"
pub "github.com/go-ap/activitypub"
"github.com/go-ap/errors"
"net/http" "net/http"
"path" "path"
"strings" "strings"
pub "github.com/go-ap/activitypub"
"github.com/go-ap/errors"
) )
// CollectionType // CollectionType

View file

@ -1,8 +1,9 @@
package handlers package handlers
import ( import (
"github.com/go-ap/activitypub"
"testing" "testing"
"github.com/go-ap/activitypub"
) )
func TestPathTyper_Type(t *testing.T) { func TestPathTyper_Type(t *testing.T) {
@ -97,7 +98,7 @@ func TestCollectionType_AddTo(t *testing.T) {
type args struct { type args struct {
i activitypub.Item i activitypub.Item
} }
var i activitypub.Item var i activitypub.Item
var o *activitypub.Object var o *activitypub.Object
tests := []struct { tests := []struct {
name string name string
@ -107,48 +108,48 @@ func TestCollectionType_AddTo(t *testing.T) {
want1 bool want1 bool
}{ }{
{ {
name: "simple", name: "simple",
t: "test", t: "test",
args: args{ args: args{
i: &activitypub.Object{ID: "http://example.com/addTo"}, i: &activitypub.Object{ID: "http://example.com/addTo"},
}, },
want: "http://example.com/addTo/test", want: "http://example.com/addTo/test",
want1: false, // this seems to always be false want1: false, // this seems to always be false
}, },
{ {
name: "on-nil-item", name: "on-nil-item",
t: "test", t: "test",
args: args{ args: args{
i: i, i: i,
}, },
want: activitypub.NilIRI, want: activitypub.NilIRI,
want1: false, want1: false,
}, },
{ {
name: "on-nil", name: "on-nil",
t: "test", t: "test",
args: args{ args: args{
i: nil, i: nil,
}, },
want: activitypub.NilIRI, want: activitypub.NilIRI,
want1: false, want1: false,
}, },
{ {
name: "on-nil-object", name: "on-nil-object",
t: "test", t: "test",
args: args{ args: args{
i: o, i: o,
}, },
want: activitypub.NilIRI, want: activitypub.NilIRI,
want1: false, want1: false,
}, },
{ {
name: "on-nil-item", name: "on-nil-item",
t: "test", t: "test",
args: args{ args: args{
i: i, i: i,
}, },
want: activitypub.NilIRI, want: activitypub.NilIRI,
want1: false, want1: false,
}, },
} }
@ -163,4 +164,4 @@ func TestCollectionType_AddTo(t *testing.T) {
} }
}) })
} }
} }