Browse Source

remove testify dep

master
Gisle Aune 4 years ago
parent
commit
a0dcd005f4
  1. 2
      go.mod
  2. 13
      go.sum
  3. 18
      isupport/isupport_test.go

2
go.mod

@ -1,5 +1,3 @@
module github.com/gissleh/irc
go 1.12
require github.com/stretchr/testify v1.4.0

13
go.sum

@ -1,13 +0,0 @@
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/gissleh/irc v0.0.0-20190420194256-9a9cd33fd83c h1:SK61/nAM56ylhrhYi1289yOBpsupGEOQTZuFYxDNhrw=
github.com/gissleh/irc v0.0.0-20190420194256-9a9cd33fd83c/go.mod h1:7uklwlzI0XI2O8ttooTH0suUpUmQ8Pviplg36smc1Aw=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

18
isupport/isupport_test.go

@ -2,7 +2,7 @@ package isupport_test
import (
"github.com/gissleh/irc/isupport"
"github.com/stretchr/testify/assert"
"reflect"
"strings"
"testing"
)
@ -39,9 +39,9 @@ func TestISupport_ParsePrefixedNick(t *testing.T) {
t.Run(row.Full, func(t *testing.T) {
nick, modes, prefixes := is.ParsePrefixedNick(row.Full)
assert.Equal(t, row.Nick, nick)
assert.Equal(t, row.Modes, modes)
assert.Equal(t, row.Prefixes, prefixes)
assertEq(t, row.Nick, nick, "nick")
assertEq(t, row.Modes, modes, "modes")
assertEq(t, row.Prefixes, prefixes, "prefixes")
})
}
}
@ -58,7 +58,7 @@ func TestISupport_IsChannel(t *testing.T) {
for channelName, isChannel := range table {
t.Run(channelName, func(t *testing.T) {
assert.Equal(t, isChannel, is.IsChannel(channelName))
assertEq(t, isChannel, is.IsChannel(channelName), "isChannel")
})
}
}
@ -77,7 +77,13 @@ func TestISupport_IsPermissionMode(t *testing.T) {
for flag, expected := range table {
t.Run(string(flag), func(t *testing.T) {
assert.Equal(t, expected, is.IsPermissionMode(flag))
assertEq(t, expected, is.IsPermissionMode(flag), "")
})
}
}
func assertEq(t *testing.T, a interface{}, b interface{}, failMessage string) {
if !reflect.DeepEqual(a, b) {
t.Errorf("Assert failed: %s (%#+v != %#+v)", failMessage, a, b)
}
}
Loading…
Cancel
Save