mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 06:12:45 +00:00
Implement ExtraPublicRoomsProvider for p2p demos (#1180)
* Change API and rename to ExtraPublicRoomsProvider * Make dendritejs work again * Maybe make libp2p demo work again * Linting
This commit is contained in:
parent
1773fd84b7
commit
6c4b8185d7
12 changed files with 433 additions and 250 deletions
|
@ -3,16 +3,26 @@ package routing
|
|||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
)
|
||||
|
||||
func pubRoom(name string) gomatrixserverlib.PublicRoom {
|
||||
return gomatrixserverlib.PublicRoom{
|
||||
Name: name,
|
||||
}
|
||||
}
|
||||
|
||||
func TestSliceInto(t *testing.T) {
|
||||
slice := []string{"a", "b", "c", "d", "e", "f", "g"}
|
||||
slice := []gomatrixserverlib.PublicRoom{
|
||||
pubRoom("a"), pubRoom("b"), pubRoom("c"), pubRoom("d"), pubRoom("e"), pubRoom("f"), pubRoom("g"),
|
||||
}
|
||||
limit := int16(3)
|
||||
testCases := []struct {
|
||||
since int64
|
||||
wantPrev int
|
||||
wantNext int
|
||||
wantSubset []string
|
||||
wantSubset []gomatrixserverlib.PublicRoom
|
||||
}{
|
||||
{
|
||||
since: 0,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue