-
Notifications
You must be signed in to change notification settings - Fork 54
feat: add function is blank() to check if a string is blank
#927
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
1513925
a299adb
33ee564
356ca38
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -243,4 +243,27 @@ class BuiltinFunctionsTest | |
| "Assertion failure on evaluate the expression 'list contains(assert(my_list, my_list != null, \"The condition is not true\"), 2)': The condition is not true" | ||
| ) | ||
| } | ||
|
|
||
| "A is blank() function" should "return Boolean" in { | ||
|
||
| evaluateExpression( | ||
| expression = """ is blank("") """ | ||
| ) should returnResult(true) | ||
|
||
|
|
||
| evaluateExpression( | ||
| expression = """ is blank(" ") """ | ||
| ) should returnResult(true) | ||
|
|
||
| evaluateExpression( | ||
| expression = """ is blank("hello world") """ | ||
| ) should returnResult(false) | ||
|
|
||
| evaluateExpression( | ||
| expression = """ is blank(" hello world ") """ | ||
| ) should returnResult(false) | ||
|
|
||
| evaluateExpression( | ||
| expression = """ is blank("\t\n\r\f") """ | ||
| ) should returnResult(true) | ||
|
||
| } | ||
|
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Since
is blank()is a function for a string argument, we should add the function to StringBuiltinFunctions.BooleanBuiltinFunctionsis for functions with a boolean argument.