Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rikinyan committed Dec 28, 2024
1 parent 290adec commit 6bfdd58
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pkg/runtime/expressions/for_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ func (iterable *testIterable) Iterate(ctx context.Context, scope *core.Scope) (c
}

func (expression *testExpression) Exec(ctx context.Context, scope *core.Scope) (core.Value, error) {
if expression.causeErrorInExec {
return nil, testError{}
}
return nil, nil
}

Expand Down Expand Up @@ -303,7 +306,7 @@ func TestExec(t *testing.T) {
Convey("Should return an error when a dataSource expression is invalid.", func() {
forExpression, _ := NewForExpression(
core.SourceMap{},
testInitTestIterable([]*core.Scope{}, true, false),
testInitTestIterable([]*core.Scope{{}, {}, {}}, true, false),
&testExpression{},
false,
false,
Expand All @@ -315,10 +318,10 @@ func TestExec(t *testing.T) {
So(err, ShouldNotBeNil)
})

Convey("Should return an error when element expressions of dataSource is invalidated.", func() {
Convey("Should return an error when element expressions of dataSource is invalid.", func() {
forExpression, _ := NewForExpression(
core.SourceMap{},
testInitTestIterable([]*core.Scope{}, false, true),
testInitTestIterable([]*core.Scope{{}, {}, {}}, false, true),
&testExpression{},
false,
false,
Expand All @@ -333,7 +336,7 @@ func TestExec(t *testing.T) {
Convey("Should return an error when an predicate expression is invalidated.", func() {
forExpression, _ := NewForExpression(
core.SourceMap{},
testInitTestIterable([]*core.Scope{}, false, true),
testInitTestIterable([]*core.Scope{{}, {}, {}}, false, false),
&testExpression{true},
false,
false,
Expand Down

0 comments on commit 6bfdd58

Please sign in to comment.