forked from External/ergo
review fix: add nil receivers to other read-only ModeSet methods
This commit is contained in:
parent
0751f52f37
commit
f408d0f37b
2 changed files with 29 additions and 7 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue