Some formatting
This commit is contained in:
parent
071af346d1
commit
4a60b3c358
5
typer.go
5
typer.go
|
@ -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
|
||||||
|
|
|
@ -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) {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue