mirror of
https://github.com/fluffle/goirc
synced 2025-07-06 21:39:21 +00:00
We need to be able to get at ChanPrivs easily.
This commit is contained in:
parent
2603e0984c
commit
47dd5b3430
4 changed files with 28 additions and 28 deletions
|
@ -346,13 +346,13 @@ func TestSTIsOn(t *testing.T) {
|
|||
chan1 := NewChannel("#test1", l)
|
||||
st.chans["#test1"] = chan1
|
||||
|
||||
if st.IsOn("#test1", "test1") {
|
||||
if priv, ok := st.IsOn("#test1", "test1"); ok || priv != nil {
|
||||
t.Errorf("test1 is not on #test1 (yet)")
|
||||
}
|
||||
cp := new(ChanPrivs)
|
||||
chan1.addNick(nick1, cp)
|
||||
nick1.addChannel(chan1, cp)
|
||||
if !st.IsOn("#test1", "test1") {
|
||||
if priv, ok := st.IsOn("#test1", "test1"); !ok || priv != cp {
|
||||
t.Errorf("test1 is on #test1 (now)")
|
||||
}
|
||||
m.CheckNothingWritten(t)
|
||||
|
@ -368,7 +368,7 @@ func TestSTAssociate(t *testing.T) {
|
|||
|
||||
st.Associate(chan1, nick1)
|
||||
m.CheckNothingWritten(t)
|
||||
if !st.IsOn("#test1", "test1") {
|
||||
if _, ok := st.IsOn("#test1", "test1"); !ok {
|
||||
t.Errorf("test1 was not associated with #test1.")
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue