botbuilder-js
botbuilder-js copied to clipboard
port: [#5800] AdaptiveExpression Bool function is not very useful because it doesn't convert anything but ints (#6431)
The changes in [#5800] AdaptiveExpression Bool function is not very useful because it doesn't convert anything but ints (#6431) may need to be ported to maintain parity with microsoft/botbuilder-dotnet.
Fixes #5800Description
This PR updated the
Boolbuilt-in function to evaluate 'true' and 'false' strings as booleans using theConvert.ToBoolean()method.Specific Changes
- Updated Function method of AdaptiveExpressions/BuiltinFunctions/Bool to evaluate strings using
Convert.ToBoolean().- Updated
AdaptiveExpressions.Tests/ExpressionParserTeststo evaluate bool('false') as false and added a new test case for bool('true')Testing
This image shows the unit tests passing.
Please review and, if necessary, port the changes.
