Check Less and LessEq in version compare. (#4532)

* Check Less and LessEq in version compare.

Thank you @cnderrauber for catching this.

* add test
This commit is contained in:
Raja Subramanian
2026-05-18 12:38:49 +05:30
committed by GitHub
parent 37eb7a3276
commit e4a8a55c4b
3 changed files with 19 additions and 5 deletions
+4
View File
@@ -136,6 +136,10 @@ func (r *ruleSdkVersion) BinaryOp(op token.Token, rhs tengo.Object) (tengo.Objec
isMatch = cmp > 0
case token.GreaterEq:
isMatch = cmp >= 0
case token.Less:
isMatch = cmp < 0
case token.LessEq:
isMatch = cmp <= 0
default:
return nil, tengo.ErrInvalidOperator
}