5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-22 12:50:27 +00:00

Update tests with gofmt

This commit is contained in:
Wim 2017-07-25 20:20:55 +02:00
parent 83ef61287e
commit 5b191f78a0
2 changed files with 13 additions and 13 deletions

View File

@ -201,10 +201,10 @@ func TestGetDestChannel(t *testing.T) {
for _, br := range r.Gateways["bridge1"].Bridges { for _, br := range r.Gateways["bridge1"].Bridges {
switch br.Account { switch br.Account {
case "discord.test": case "discord.test":
assert.Equal(t, []config.ChannelInfo{config.ChannelInfo{Name: "general", Account: "discord.test", Direction: "inout", ID: "generaldiscord.test", SameChannel: map[string]bool{"bridge1": false}, Options: config.ChannelOptions{Key: ""}}}, assert.Equal(t, []config.ChannelInfo{{Name: "general", Account: "discord.test", Direction: "inout", ID: "generaldiscord.test", SameChannel: map[string]bool{"bridge1": false}, Options: config.ChannelOptions{Key: ""}}},
r.Gateways["bridge1"].getDestChannel(msg, *br)) r.Gateways["bridge1"].getDestChannel(msg, *br))
case "slack.test": case "slack.test":
assert.Equal(t, []config.ChannelInfo{config.ChannelInfo{Name: "testing", Account: "slack.test", Direction: "out", ID: "testingslack.test", SameChannel: map[string]bool{"bridge1": false}, Options: config.ChannelOptions{Key: ""}}}, assert.Equal(t, []config.ChannelInfo{{Name: "testing", Account: "slack.test", Direction: "out", ID: "testingslack.test", SameChannel: map[string]bool{"bridge1": false}, Options: config.ChannelOptions{Key: ""}}},
r.Gateways["bridge1"].getDestChannel(msg, *br)) r.Gateways["bridge1"].getDestChannel(msg, *br))
case "gitter.42wim": case "gitter.42wim":
assert.Equal(t, []config.ChannelInfo(nil), r.Gateways["bridge1"].getDestChannel(msg, *br)) assert.Equal(t, []config.ChannelInfo(nil), r.Gateways["bridge1"].getDestChannel(msg, *br))
@ -239,11 +239,11 @@ func TestGetDestChannelAdvanced(t *testing.T) {
hits[gw.Name]++ hits[gw.Name]++
switch br.Account { switch br.Account {
case "irc.zzz": case "irc.zzz":
assert.Equal(t, []config.ChannelInfo{config.ChannelInfo{Name: "#main", Account: "irc.zzz", Direction: "inout", ID: "#mainirc.zzz", SameChannel: map[string]bool{"bridge": false}, Options: config.ChannelOptions{Key: ""}}}, channels) assert.Equal(t, []config.ChannelInfo{{Name: "#main", Account: "irc.zzz", Direction: "inout", ID: "#mainirc.zzz", SameChannel: map[string]bool{"bridge": false}, Options: config.ChannelOptions{Key: ""}}}, channels)
case "telegram.zzz": case "telegram.zzz":
assert.Equal(t, []config.ChannelInfo{config.ChannelInfo{Name: "-1111111111111", Account: "telegram.zzz", Direction: "inout", ID: "-1111111111111telegram.zzz", SameChannel: map[string]bool{"bridge": false}, Options: config.ChannelOptions{Key: ""}}}, channels) assert.Equal(t, []config.ChannelInfo{{Name: "-1111111111111", Account: "telegram.zzz", Direction: "inout", ID: "-1111111111111telegram.zzz", SameChannel: map[string]bool{"bridge": false}, Options: config.ChannelOptions{Key: ""}}}, channels)
case "slack.zzz": case "slack.zzz":
assert.Equal(t, []config.ChannelInfo{config.ChannelInfo{Name: "irc", Account: "slack.zzz", Direction: "inout", ID: "ircslack.zzz", SameChannel: map[string]bool{"bridge": false}, Options: config.ChannelOptions{Key: ""}}}, channels) assert.Equal(t, []config.ChannelInfo{{Name: "irc", Account: "slack.zzz", Direction: "inout", ID: "ircslack.zzz", SameChannel: map[string]bool{"bridge": false}, Options: config.ChannelOptions{Key: ""}}}, channels)
} }
} }
case "bridge2": case "bridge2":
@ -251,9 +251,9 @@ func TestGetDestChannelAdvanced(t *testing.T) {
hits[gw.Name]++ hits[gw.Name]++
switch br.Account { switch br.Account {
case "irc.zzz": case "irc.zzz":
assert.Equal(t, []config.ChannelInfo{config.ChannelInfo{Name: "#main-help", Account: "irc.zzz", Direction: "inout", ID: "#main-helpirc.zzz", SameChannel: map[string]bool{"bridge2": false}, Options: config.ChannelOptions{Key: ""}}}, channels) assert.Equal(t, []config.ChannelInfo{{Name: "#main-help", Account: "irc.zzz", Direction: "inout", ID: "#main-helpirc.zzz", SameChannel: map[string]bool{"bridge2": false}, Options: config.ChannelOptions{Key: ""}}}, channels)
case "telegram.zzz": case "telegram.zzz":
assert.Equal(t, []config.ChannelInfo{config.ChannelInfo{Name: "--444444444444", Account: "telegram.zzz", Direction: "inout", ID: "--444444444444telegram.zzz", SameChannel: map[string]bool{"bridge2": false}, Options: config.ChannelOptions{Key: ""}}}, channels) assert.Equal(t, []config.ChannelInfo{{Name: "--444444444444", Account: "telegram.zzz", Direction: "inout", ID: "--444444444444telegram.zzz", SameChannel: map[string]bool{"bridge2": false}, Options: config.ChannelOptions{Key: ""}}}, channels)
} }
} }
case "bridge3": case "bridge3":
@ -261,9 +261,9 @@ func TestGetDestChannelAdvanced(t *testing.T) {
hits[gw.Name]++ hits[gw.Name]++
switch br.Account { switch br.Account {
case "irc.zzz": case "irc.zzz":
assert.Equal(t, []config.ChannelInfo{config.ChannelInfo{Name: "#main-telegram", Account: "irc.zzz", Direction: "inout", ID: "#main-telegramirc.zzz", SameChannel: map[string]bool{"bridge3": false}, Options: config.ChannelOptions{Key: ""}}}, channels) assert.Equal(t, []config.ChannelInfo{{Name: "#main-telegram", Account: "irc.zzz", Direction: "inout", ID: "#main-telegramirc.zzz", SameChannel: map[string]bool{"bridge3": false}, Options: config.ChannelOptions{Key: ""}}}, channels)
case "telegram.zzz": case "telegram.zzz":
assert.Equal(t, []config.ChannelInfo{config.ChannelInfo{Name: "--333333333333", Account: "telegram.zzz", Direction: "inout", ID: "--333333333333telegram.zzz", SameChannel: map[string]bool{"bridge3": false}, Options: config.ChannelOptions{Key: ""}}}, channels) assert.Equal(t, []config.ChannelInfo{{Name: "--333333333333", Account: "telegram.zzz", Direction: "inout", ID: "--333333333333telegram.zzz", SameChannel: map[string]bool{"bridge3": false}, Options: config.ChannelOptions{Key: ""}}}, channels)
} }
} }
case "announcements": case "announcements":
@ -274,11 +274,11 @@ func TestGetDestChannelAdvanced(t *testing.T) {
hits[gw.Name]++ hits[gw.Name]++
switch br.Account { switch br.Account {
case "irc.zzz": case "irc.zzz":
assert.Equal(t, []config.ChannelInfo{config.ChannelInfo{Name: "#main", Account: "irc.zzz", Direction: "out", ID: "#mainirc.zzz", SameChannel: map[string]bool{"announcements": false}, Options: config.ChannelOptions{Key: ""}}, config.ChannelInfo{Name: "#main-help", Account: "irc.zzz", Direction: "out", ID: "#main-helpirc.zzz", SameChannel: map[string]bool{"announcements": false}, Options: config.ChannelOptions{Key: ""}}}, channels) assert.Equal(t, []config.ChannelInfo{{Name: "#main", Account: "irc.zzz", Direction: "out", ID: "#mainirc.zzz", SameChannel: map[string]bool{"announcements": false}, Options: config.ChannelOptions{Key: ""}}, {Name: "#main-help", Account: "irc.zzz", Direction: "out", ID: "#main-helpirc.zzz", SameChannel: map[string]bool{"announcements": false}, Options: config.ChannelOptions{Key: ""}}}, channels)
case "slack.zzz": case "slack.zzz":
assert.Equal(t, []config.ChannelInfo{config.ChannelInfo{Name: "general", Account: "slack.zzz", Direction: "out", ID: "generalslack.zzz", SameChannel: map[string]bool{"announcements": false}, Options: config.ChannelOptions{Key: ""}}}, channels) assert.Equal(t, []config.ChannelInfo{{Name: "general", Account: "slack.zzz", Direction: "out", ID: "generalslack.zzz", SameChannel: map[string]bool{"announcements": false}, Options: config.ChannelOptions{Key: ""}}}, channels)
case "telegram.zzz": case "telegram.zzz":
assert.Equal(t, []config.ChannelInfo{config.ChannelInfo{Name: "--333333333333", Account: "telegram.zzz", Direction: "out", ID: "--333333333333telegram.zzz", SameChannel: map[string]bool{"announcements": false}, Options: config.ChannelOptions{Key: ""}}}, channels) assert.Equal(t, []config.ChannelInfo{{Name: "--333333333333", Account: "telegram.zzz", Direction: "out", ID: "--333333333333telegram.zzz", SameChannel: map[string]bool{"announcements": false}, Options: config.ChannelOptions{Key: ""}}}, channels)
} }
} }
} }

View File

@ -27,5 +27,5 @@ func TestGetConfig(t *testing.T) {
} }
sgw := New(cfg) sgw := New(cfg)
configs := sgw.GetConfig() configs := sgw.GetConfig()
assert.Equal(t, []config.Gateway{config.Gateway{Name: "blah", Enable: true, In: []config.Bridge(nil), Out: []config.Bridge(nil), InOut: []config.Bridge{config.Bridge{Account: "mattermost.test", Channel: "testing", Options: config.ChannelOptions{Key: ""}, SameChannel: true}, config.Bridge{Account: "mattermost.test", Channel: "testing2", Options: config.ChannelOptions{Key: ""}, SameChannel: true}, config.Bridge{Account: "mattermost.test", Channel: "testing10", Options: config.ChannelOptions{Key: ""}, SameChannel: true}, config.Bridge{Account: "slack.test", Channel: "testing", Options: config.ChannelOptions{Key: ""}, SameChannel: true}, config.Bridge{Account: "slack.test", Channel: "testing2", Options: config.ChannelOptions{Key: ""}, SameChannel: true}, config.Bridge{Account: "slack.test", Channel: "testing10", Options: config.ChannelOptions{Key: ""}, SameChannel: true}}}}, configs) assert.Equal(t, []config.Gateway{{Name: "blah", Enable: true, In: []config.Bridge(nil), Out: []config.Bridge(nil), InOut: []config.Bridge{{Account: "mattermost.test", Channel: "testing", Options: config.ChannelOptions{Key: ""}, SameChannel: true}, {Account: "mattermost.test", Channel: "testing2", Options: config.ChannelOptions{Key: ""}, SameChannel: true}, {Account: "mattermost.test", Channel: "testing10", Options: config.ChannelOptions{Key: ""}, SameChannel: true}, {Account: "slack.test", Channel: "testing", Options: config.ChannelOptions{Key: ""}, SameChannel: true}, {Account: "slack.test", Channel: "testing2", Options: config.ChannelOptions{Key: ""}, SameChannel: true}, {Account: "slack.test", Channel: "testing10", Options: config.ChannelOptions{Key: ""}, SameChannel: true}}}}, configs)
} }