mirror of
https://github.com/MontFerret/ferret.git
synced 2024-12-12 11:15:14 +02:00
Merge pull request #49 from esell/runtime-tests
more unit test for runtime/core - errors
This commit is contained in:
commit
631f452d2a
@ -22,6 +22,23 @@ func TestSourceError(t *testing.T) {
|
||||
})
|
||||
}
|
||||
|
||||
func TestTypeError(t *testing.T) {
|
||||
Convey("Should match", t, func() {
|
||||
e := core.TypeError(core.BooleanType)
|
||||
So(e, ShouldNotBeNil)
|
||||
|
||||
e = core.TypeError(core.BooleanType, core.BooleanType)
|
||||
So(e, ShouldNotBeNil)
|
||||
|
||||
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(core.NoneType, core.NoneType, core.BooleanType, core.IntType, core.FloatType)
|
||||
So(e.Error(), ShouldEqual, cause.Error())
|
||||
})
|
||||
}
|
||||
|
||||
func TestError(t *testing.T) {
|
||||
Convey("Should match", t, func() {
|
||||
msg := "test message"
|
||||
|
Loading…
Reference in New Issue
Block a user