diff --git a/doc/Makefile b/doc/Makefile index b2c588c..a98a3d0 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -11,7 +11,7 @@ ROBOT2RST = robot2rst ROBOT2RST_OPTS += -i $(SOURCEDIR)/robot/example.robot ROBOT2RST_OPTS += -o $(SOURCEDIR)/example_usage_qtp.rst ROBOT2RST_OPTS += -t ^SWRQT- ^SYSRQT- -ROBOT2RST_OPTS += -c 100 50.0 +ROBOT2RST_OPTS += -c 100 40.0 ROBOT2RST_OPTS += -r validates ext_toolname ROBOT2RST_OPTS += --only FLASH diff --git a/doc/source/robot/example.robot b/doc/source/robot/example.robot index 6e734a1..ab3c5a6 100644 --- a/doc/source/robot/example.robot +++ b/doc/source/robot/example.robot @@ -37,6 +37,10 @@ Another Test FOR ${var} IN @{NAMES} Log ${var} +Comp1: testing 'Special" characters & prefix (with brackets) + [Documentation] The item ID will contain COMP1-TESTING_SPECIAL_CHARACTERS_AND_PREFIX_WITH_BRACKETS. + Log Special characters in test case names are supported but not recommended. + *** Keywords *** My Keyword [Documentation] My keyword's documentation string. diff --git a/mlx/robot2rst.mako b/mlx/robot2rst.mako index 532b884..a778083 100644 --- a/mlx/robot2rst.mako +++ b/mlx/robot2rst.mako @@ -20,8 +20,12 @@ def to_traceable_item(name, prefix=''): name = prefix + name # Move to capitals name = name.upper() - # Move ' : ' (or alike) to '-' + # Replace ' : ' (or alike) by '-' name = re.sub('\s*:\s*', '-', name) + # Replace '&' by 'AND' + name = name.replace('&', 'AND') + # Remove other special characters + name = re.sub('[^\w\s_-]', '', name) # Replace spaces with single underscore name = re.sub('\s+', '_', name) return name