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 (
"fmt"
pub "github.com/go-ap/activitypub"
"github.com/go-ap/errors"
"net/http"
"path"
"strings"
pub "github.com/go-ap/activitypub"
"github.com/go-ap/errors"
)
// CollectionType

View file

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