diff options
author | Tulir Asokan <tulir@maunium.net> | 2018-05-02 23:45:17 +0300 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2018-05-02 23:52:38 +0300 |
commit | a9390d3b5c308ccab7f15748a6187865988dafe2 (patch) | |
tree | e54410188cbbbd9e33a607411ba44301faa46208 /matrix/rooms | |
parent | 9dabaa26c7fa9bd79805b0dbd626c5386f805afb (diff) |
Add more session and config tests
Diffstat (limited to 'matrix/rooms')
-rw-r--r-- | matrix/rooms/room_test.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/matrix/rooms/room_test.go b/matrix/rooms/room_test.go index 40624e1..2ad8d54 100644 --- a/matrix/rooms/room_test.go +++ b/matrix/rooms/room_test.go @@ -59,6 +59,22 @@ func TestRoom_GetTopic(t *testing.T) { assert.Equal(t, "test topic", room.GetTopic()) } +func TestRoom_Tags_Empty(t *testing.T) { + room := rooms.NewRoom("!test:maunium.net", "@tulir:maunium.net") + assert.Empty(t, room.RawTags) + tags := room.Tags() + assert.Len(t, tags, 1) + assert.Equal(t, "", tags[0].Tag) + assert.Equal(t, 0.5, tags[0].Order) +} + +func TestRoom_Tags_NotEmpty(t *testing.T) { + room := rooms.NewRoom("!test:maunium.net", "@tulir:maunium.net") + room.RawTags = []rooms.RoomTag{{"foo", 1}, {"bar", 1}} + tags := room.Tags() + assert.Equal(t, room.RawTags, tags) +} + func TestRoom_GetAliases(t *testing.T) { room := rooms.NewRoom("!test:maunium.net", "@tulir:maunium.net") addAliases(room) |