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

Added support of error supression to inline expressions (#671)

* Added support of error supression to inline expressions
This commit is contained in:
Tim Voronov
2021-09-20 00:53:00 -04:00
committed by GitHub
parent 658e929c5a
commit 2f399c669e
16 changed files with 1793 additions and 1485 deletions

View File

@@ -22,7 +22,6 @@ func TestFunctionCallExpression(t *testing.T) {
return values.True, nil
},
false,
)
So(err, ShouldBeNil)
@@ -48,7 +47,6 @@ func TestFunctionCallExpression(t *testing.T) {
return values.True, nil
},
false,
args...,
)
@@ -75,7 +73,6 @@ func TestFunctionCallExpression(t *testing.T) {
return values.True, nil
},
false,
args...,
)
@@ -96,11 +93,15 @@ func TestFunctionCallExpression(t *testing.T) {
func(ctx context.Context, args ...core.Value) (value core.Value, e error) {
return values.NewString("booo"), core.ErrNotImplemented
},
true,
)
So(err, ShouldBeNil)
out, err := f.Exec(context.Background(), rootScope.Fork())
fse, err := expressions.SuppressErrors(f)
So(err, ShouldBeNil)
out, err := fse.Exec(context.Background(), rootScope.Fork())
So(err, ShouldBeNil)
So(out.Type().String(), ShouldEqual, types.None.String())