We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 46f608f commit 2e0e779Copy full SHA for 2e0e779
rosidl_adapter/test/test_constant.py
@@ -12,6 +12,8 @@
12
# See the License for the specific language governing permissions and
13
# limitations under the License.
14
15
+import math
16
+
17
import pytest
18
19
from rosidl_adapter.parser import Constant
@@ -31,14 +33,9 @@ def test_constant_constructor():
31
33
Constant('bool', 'FOO', None)
32
34
35
# NaN is case insensitive in python, so test a few variations.
- value = Constant('float32', 'FOO', 'nan')
- value = Constant('float32', 'FOO', 'Nan')
36
- value = Constant('float32', 'FOO', 'NaN')
37
- value = Constant('float32', 'FOO', 'NAN')
38
- value = Constant('float64', 'FOO', 'nan')
39
- value = Constant('float64', 'FOO', 'Nan')
40
- value = Constant('float64', 'FOO', 'NaN')
41
- value = Constant('float64', 'FOO', 'NAN')
+ for nan_string in ['nan', 'Nan', 'NaN', 'NAN', 'nan', 'Nan', 'NaN', 'NAN']:
+ value = Constant('float32', 'FOO', nan_string)
+ assert math.isnan(value.value)
42
43
44
def test_constant_methods():
0 commit comments