botbuilder-js icon indicating copy to clipboard operation
botbuilder-js copied to clipboard

port: [#5800] AdaptiveExpression Bool function is not very useful because it doesn't convert anything but ints (#6431)

Open github-actions[bot] opened this issue 3 years ago • 0 comments

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 #5800

Description

This PR updated the Bool built-in function to evaluate 'true' and 'false' strings as booleans using the Convert.ToBoolean() method.

Specific Changes

  • Updated Function method of AdaptiveExpressions/BuiltinFunctions/Bool to evaluate strings using Convert.ToBoolean().
  • Updated AdaptiveExpressions.Tests/ExpressionParserTests to evaluate bool('false') as false and added a new test case for bool('true')

Testing

This image shows the unit tests passing. image

Please review and, if necessary, port the changes.

github-actions[bot] avatar Aug 09 '22 14:08 github-actions[bot]