Skip to content

Commit fbb71e7

Browse files
authored
update channel width (#31)
1 parent e585962 commit fbb71e7

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

internal/irc/twitch_test.go

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,16 @@ import (
99
"github.com/charmbracelet/lipgloss"
1010
)
1111

12-
// build a Private Message
13-
// call callback function pasisng in pm
14-
type irc struct {
12+
type mockIrc struct {
1513
callback func(types.PrivateMessage)
1614
}
1715

18-
// pass in the callback function
19-
func (i *irc) OnPrivateMessage(f func(types.PrivateMessage)) error {
16+
func (i *mockIrc) OnPrivateMessage(f func(types.PrivateMessage)) error {
2017
i.callback = f
2118
return nil
2219
}
2320

24-
func (i *irc) Publish(string, string) error { return nil }
21+
func (i *mockIrc) Publish(string, string) error { return nil }
2522

2623
func TestIncomingMessages(t *testing.T) {
2724
tests := []struct {
@@ -86,7 +83,7 @@ func TestIncomingMessages(t *testing.T) {
8683

8784
for _, test := range tests {
8885
t.Run(test.Name, func(t *testing.T) {
89-
incomingIRC := &irc{}
86+
incomingIRC := &mockIrc{}
9087
i := NewTwitch(incomingIRC, log.Default(), test.userDisplayName, "testChannel")
9188

9289
s := i.IncomingMessages()
@@ -124,7 +121,7 @@ func TestPublish(t *testing.T) {
124121

125122
for _, test := range tests {
126123
t.Run(test.Name, func(t *testing.T) {
127-
incomingIRC := &irc{}
124+
incomingIRC := &mockIrc{}
128125
i := NewTwitch(incomingIRC, log.Default(), test.name, "testChannel")
129126

130127
s := i.IncomingMessages()

internal/terminal/channel.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,5 @@ out:
9898
}
9999
}
100100
c.lines = newLines
101+
c.width = width
101102
}

0 commit comments

Comments
 (0)