1
0
Fork 0
forked from External/ergo
Also fix some issues with STATUSMSG
This commit is contained in:
Shivaram Lingamneni 2019-04-23 00:05:12 -04:00
parent 8c68b9f8d7
commit 30f6e11698
6 changed files with 105 additions and 66 deletions

View file

@ -90,3 +90,26 @@ func TestNilReceivers(t *testing.T) {
t.Errorf("nil Modeset should have empty String(), got %v instead", str)
}
}
func TestHighestChannelUserMode(t *testing.T) {
set := NewModeSet()
if set.HighestChannelUserMode() != Mode(0) {
t.Errorf("no channel user modes should be present yet")
}
set.SetMode(Voice, true)
if set.HighestChannelUserMode() != Voice {
t.Errorf("should see that user is voiced")
}
set.SetMode(ChannelAdmin, true)
if set.HighestChannelUserMode() != ChannelAdmin {
t.Errorf("should see that user has channel admin")
}
set = nil
if set.HighestChannelUserMode() != Mode(0) {
t.Errorf("nil modeset should have the zero mode as highest channel-user mode")
}
}