mirror of https://github.com/fluffle/goirc
Run gofmt to fix some trailing whitespace &c.
This commit is contained in:
parent
e935d78bb7
commit
1e190eb233
|
@ -405,12 +405,12 @@ func Test353(t *testing.T) {
|
||||||
s.st.EXPECT().ChannelModes("#test1", "+o", "user1"),
|
s.st.EXPECT().ChannelModes("#test1", "+o", "user1"),
|
||||||
)
|
)
|
||||||
for n, m := range map[string]string{
|
for n, m := range map[string]string{
|
||||||
"user2": "",
|
"user2": "",
|
||||||
"voice": "+v",
|
"voice": "+v",
|
||||||
"halfop": "+h",
|
"halfop": "+h",
|
||||||
"op": "+o",
|
"op": "+o",
|
||||||
"admin": "+a",
|
"admin": "+a",
|
||||||
"owner": "+q",
|
"owner": "+q",
|
||||||
} {
|
} {
|
||||||
calls := []*gomock.Call{
|
calls := []*gomock.Call{
|
||||||
s.st.EXPECT().GetNick(n).Return(nil),
|
s.st.EXPECT().GetNick(n).Return(nil),
|
||||||
|
|
|
@ -68,8 +68,9 @@ func (line *Line) Public() bool {
|
||||||
switch line.Cmd {
|
switch line.Cmd {
|
||||||
case PRIVMSG, NOTICE, ACTION:
|
case PRIVMSG, NOTICE, ACTION:
|
||||||
switch line.Args[0][0] {
|
switch line.Args[0][0] {
|
||||||
case '#', '&', '+', '!': return true
|
case '#', '&', '+', '!':
|
||||||
}
|
return true
|
||||||
|
}
|
||||||
case CTCP, CTCPREPLY:
|
case CTCP, CTCPREPLY:
|
||||||
// CTCP prepends the CTCP verb to line.Args, thus for the message
|
// CTCP prepends the CTCP verb to line.Args, thus for the message
|
||||||
// :nick!user@host PRIVMSG #foo :\001BAR baz\001
|
// :nick!user@host PRIVMSG #foo :\001BAR baz\001
|
||||||
|
@ -78,13 +79,13 @@ func (line *Line) Public() bool {
|
||||||
// line.Args containing: []string{"#foo", "BAR", "baz"}
|
// line.Args containing: []string{"#foo", "BAR", "baz"}
|
||||||
// ... OR change conn.Ctcp()'s argument order to be consistent.
|
// ... OR change conn.Ctcp()'s argument order to be consistent.
|
||||||
switch line.Args[1][0] {
|
switch line.Args[1][0] {
|
||||||
case '#', '&', '+', '!': return true
|
case '#', '&', '+', '!':
|
||||||
}
|
return true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ParseLine creates a Line from an incoming message from the IRC server.
|
// ParseLine creates a Line from an incoming message from the IRC server.
|
||||||
//
|
//
|
||||||
// It contains special casing for CTCP messages, most notably CTCP ACTION.
|
// It contains special casing for CTCP messages, most notably CTCP ACTION.
|
||||||
|
|
|
@ -44,7 +44,10 @@ func TestLineCopy(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestLineText(t *testing.T) {
|
func TestLineText(t *testing.T) {
|
||||||
tests := []struct{in *Line; out string}{
|
tests := []struct {
|
||||||
|
in *Line
|
||||||
|
out string
|
||||||
|
}{
|
||||||
{&Line{}, ""},
|
{&Line{}, ""},
|
||||||
{&Line{Args: []string{"one thing"}}, "one thing"},
|
{&Line{Args: []string{"one thing"}}, "one thing"},
|
||||||
{&Line{Args: []string{"one", "two"}}, "two"},
|
{&Line{Args: []string{"one", "two"}}, "two"},
|
||||||
|
@ -59,7 +62,10 @@ func TestLineText(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestLineTarget(t *testing.T) {
|
func TestLineTarget(t *testing.T) {
|
||||||
tests := []struct{in *Line; out string}{
|
tests := []struct {
|
||||||
|
in *Line
|
||||||
|
out string
|
||||||
|
}{
|
||||||
{&Line{}, ""},
|
{&Line{}, ""},
|
||||||
{&Line{Cmd: JOIN, Args: []string{"#foo"}}, "#foo"},
|
{&Line{Cmd: JOIN, Args: []string{"#foo"}}, "#foo"},
|
||||||
{&Line{Cmd: PART, Args: []string{"#foo", "bye"}}, "#foo"},
|
{&Line{Cmd: PART, Args: []string{"#foo", "bye"}}, "#foo"},
|
||||||
|
|
Loading…
Reference in New Issue