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:
parent
54a8c0f81b
commit
3c78bca385
@ -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())
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user