1
0
mirror of https://github.com/MontFerret/ferret.git synced 2025-08-15 20:02:56 +02:00

more unit test for runtime/core - errors

This commit is contained in:
esell
2018-10-05 09:51:43 -06:00
parent 94f8398255
commit 54a8c0f81b

View File

@@ -22,6 +22,23 @@ func TestSourceError(t *testing.T) {
})
}
func TestTypeError(t *testing.T) {
Convey("Should match", t, func() {
e := core.TypeError(1)
So(e, ShouldNotBeNil)
e = core.TypeError(1, 1)
So(e, ShouldNotBeNil)
e = core.TypeError(1, 1, 2, 3)
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)
So(e.Error(), ShouldEqual, cause.Error())
})
}
func TestError(t *testing.T) {
Convey("Should match", t, func() {
msg := "test message"