1
0
Fork 0
forked from External/ergo

review fix: add nil receivers to other read-only ModeSet methods

This commit is contained in:
Shivaram Lingamneni 2018-05-23 15:39:30 -04:00
parent 0751f52f37
commit f408d0f37b
2 changed files with 29 additions and 7 deletions

View file

@ -35,3 +35,16 @@ func TestSetMode(t *testing.T) {
t.Errorf("unexpected modestring: %s", modeString)
}
}
func TestNilReceivers(t *testing.T) {
var set ModeSet
if set.HasMode(Invisible) {
t.Errorf("nil ModeSet should not have any modes")
}
str := set.String()
if str != "" {
t.Errorf("nil Modeset should have empty String(), got %v instead", str)
}
}