ros2 / launch

Tools for launching multiple processes and for writing tests involving multiple processes.
Apache License 2.0
124 stars 139 forks source link

Add special cases to coerce "1" and "0" to bool when using bool coercion only #651

Closed methylDragon closed 1 year ago

methylDragon commented 2 years ago

Description

Exactly as the title says.

Given that "1" and "0" are valid true and false expressions according to the conditions, I think it makes sense to allow coercion of the "1" and "0" strings to True and False.

This ONLY affects coercion when bool is explicitly passed to it. It's as small a change as possible.

This supports the work in https://github.com/ros2/launch/pull/649 and will be used to support the boolean substitution implementations.

Tests

Special note: This means that one test for the type coercion will no longer apply.

Beyond that, relevant tests have been implemented.

methylDragon commented 2 years ago