Skip to content

Commit 9510146

Browse files
mmetcblotus
andauthored
update expr to 1.17.2 (#3519)
* update expr to 1.17.2 * add if test --------- Co-authored-by: Sebastien Blot <[email protected]>
1 parent ce6018f commit 9510146

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ require (
3333
github.com/docker/docker v27.3.1+incompatible
3434
github.com/docker/go-connections v0.5.0
3535
github.com/docker/go-units v0.5.0 // indirect
36-
github.com/expr-lang/expr v1.16.9
36+
github.com/expr-lang/expr v1.17.2
3737
github.com/fatih/color v1.18.0
3838
github.com/fsnotify/fsnotify v1.7.0
3939
github.com/gin-gonic/gin v1.10.0

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ github.com/docker/go-units v0.3.3/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDD
134134
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
135135
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
136136
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
137-
github.com/expr-lang/expr v1.16.9 h1:WUAzmR0JNI9JCiF0/ewwHB1gmcGw5wW7nWt8gc6PpCI=
138-
github.com/expr-lang/expr v1.16.9/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4=
137+
github.com/expr-lang/expr v1.17.2 h1:o0A99O/Px+/DTjEnQiodAgOIK9PPxL8DtXhBRKC+Iso=
138+
github.com/expr-lang/expr v1.17.2/go.mod h1:8/vRC7+7HBzESEqt5kKpYXxrxkr31SaO8r40VO/1IT4=
139139
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
140140
github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM=
141141
github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU=

pkg/exprhelpers/debugger_test.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//go:build expr_debug
2+
23
package exprhelpers
34

45
import (
@@ -273,6 +274,20 @@ func TestBaseDbg(t *testing.T) {
273274
{Code: "and", CodeDepth: 0, JumpIf: true, IfFalse: true, StrConditionResult: "false", ConditionResult: boolPtr(false), Finalized: true},
274275
},
275276
},
277+
{
278+
Name: "if",
279+
Expr: `if base_int != 42 {
280+
true
281+
} else {
282+
false
283+
}`,
284+
Env: defaultEnv,
285+
ExpectedOutputs: []OpOutput{
286+
{Code: "!= 42 {", CodeDepth: 0, Negated: true, Comparison: true, Left: "42", Right: "42", StrConditionResult: "[true]", ConditionResult: boolPtr(true), Finalized: true},
287+
{Code: "if base_int != 42 {", CodeDepth: 0, ConditionResult: boolPtr(false), Finalized: false, IfFalse: true, JumpIf: true, StrConditionResult: "false"},
288+
{Code: "false }", CodeDepth: 0, StrConditionResult: "false", Condition: true, ConditionResult: boolPtr(false), Finalized: true},
289+
},
290+
},
276291
}
277292

278293
logger := log.WithField("test", "exprhelpers")

0 commit comments

Comments
 (0)