1
0
mirror of https://github.com/MontFerret/ferret.git synced 2024-12-14 11:23:02 +02:00

swap magic numbers for enums in errors_test.go

This commit is contained in:
esell 2018-10-05 10:07:31 -06:00
parent 54a8c0f81b
commit 3c78bca385
No known key found for this signature in database
GPG Key ID: AA236B684EC0213E

View File

@ -24,17 +24,17 @@ func TestSourceError(t *testing.T) {
func TestTypeError(t *testing.T) {
Convey("Should match", t, func() {
e := core.TypeError(1)
e := core.TypeError(core.BooleanType)
So(e, ShouldNotBeNil)
e = core.TypeError(1, 1)
e = core.TypeError(core.BooleanType, core.BooleanType)
So(e, ShouldNotBeNil)
e = core.TypeError(1, 1, 2, 3)
e = core.TypeError(core.BooleanType, core.BooleanType, core.IntType, core.FloatType)
So(e, ShouldNotBeNil)
cause := errors.New("invalid type: expected none or boolean or int or float, but got none")
e = core.TypeError(0, 0, 1, 2, 3)
e = core.TypeError(core.NoneType, core.NoneType, core.BooleanType, core.IntType, core.FloatType)
So(e.Error(), ShouldEqual, cause.Error())
})
}