diff --git a/tests/atest/transformers/NormalizeSectionHeaderName/source/disablers.robot b/tests/atest/transformers/NormalizeSectionHeaderName/source/disablers.robot index 838d1127..b5a6e179 100644 --- a/tests/atest/transformers/NormalizeSectionHeaderName/source/disablers.robot +++ b/tests/atest/transformers/NormalizeSectionHeaderName/source/disablers.robot @@ -4,4 +4,4 @@ *KEYWORDs data driven columns for col names # robotidy: off -*** coMment *** # robotidy: off +*** coMment *** # robotidy: off diff --git a/tests/atest/transformers/RenameVariables/expected/test_lower_with_nested.robot b/tests/atest/transformers/RenameVariables/expected/test_lower_with_nested.robot new file mode 100644 index 00000000..d5649e34 --- /dev/null +++ b/tests/atest/transformers/RenameVariables/expected/test_lower_with_nested.robot @@ -0,0 +1,115 @@ +*** Settings *** +Library ExampleLibrary @{lib_args} +Library ${library} @{lib_args} + +Variables ${name}.py +Resource ${curdir}/${name}.robot + +Suite Setup Some Keyword @{kw_args} +Suite Teardown ${keyword} @{kw_args} +Test Setup Some Keyword @{kw_args} +Test Teardown ${keyword} @{kw_args} + +Default Tags @{tags} tag_${name} +Test Timeout ${timeout} + +Metadata ${item} ${value} + + +*** Variables *** +${variable} value_ +${var_iable} ${va_lue} +${variable} This is string with ${variable} +${${var}} value +${variable} ${${variable}} +${variable} ${var_${variable}_var} +${variable} String with ${${variable}} +${variable} ${variable['item_access']} +${variable} ${variable}[item_access] +${variable} ${variable}[${item}_access] +${variable} ${variable['${variable}']} +${variable} ${_}____ +${vari_able} ${wo_rd} +${variable} \${escaped} +${inline_eval} ${{ eval }} + +&{dict} item=value +... item=${value} +@{list} value +... other ${value} +... ${{embedd_ ed} + +${camel_case_name} ${camel_case_name} +${camel_case_name} ${camel_case_name} +${camel_case_name} ${camel_case_name} +${camel_case_name_word_camel_case} ${camel_case_name_word_camel_case} + + +*** Test Cases *** +Assign + ${variable} Keyword + ${multiple} + ... ${variables} Keyword + ${variable} = Keyword + ${variable}= Keyword + Keyword ${nested_${variable}} + +Args + Keyword ${variable} + Keyword ${v_a_ri_ables} + ... value with ${variable} + +For header + ${local} Set Variable item + FOR ${item} IN @{list} + Log ${item} + Do Stuff String with ${local} value + ... ${lo_cal} # TODO We could normalize it to look as first local matching variable + END + Log ${global} + Log ${item} + FOR ${index} ${item} IN ENUMERATE @{list} + Log ${index} ${item} + END + Log ${local['item']} + Log ${global['item']} + +Test With Variables In Keyword Call + [Setup] ${keyword} + ${local} Set Variable local value + Keyword Call With ${variable} + Keyword Call With ${local} + ${global} Keyword Call With ${global} + [Teardown] ${local} + +Test case with ${VARIABLE} in name + [Documentation] The RF surprises me vol. 678 + Step + + +*** Keywords *** +Arguments + [Arguments] ${arg} ${arg2} + Step ${arg} + Step ${arg3} + +Kwargs + [Arguments] ${arg} &{kwargs} + Step + +Defaults + [Arguments] ${arg} ${arg2} = 'default' + Step + +Defaults With Global + [Arguments] ${arg} ${arg2} =${global} + Step + +Defaults With Other Arg + [Arguments] ${arg} ${arg2} = ${arg} + Step + +Embedded ${arguments} that ${should_be_lower} and also ${pattern:\S} + Log ${should_be_lower} + Log ${global} + Log ${pattern} diff --git a/tests/atest/transformers/RenameVariables/test_transformer.py b/tests/atest/transformers/RenameVariables/test_transformer.py index 2064424d..98a8a5b4 100644 --- a/tests/atest/transformers/RenameVariables/test_transformer.py +++ b/tests/atest/transformers/RenameVariables/test_transformer.py @@ -26,6 +26,15 @@ def test_lower_case(self): source="test.robot", expected="test_lower.robot", config=":settings_section_case=lower:variables_section_case=lower:unknown_variables_case=lower", + target_version="<6.1", + ) + + def test_lower_case_rf61(self): + self.compare( + source="test.robot", + expected="test_lower_with_nested.robot", + config=":settings_section_case=lower:variables_section_case=lower:unknown_variables_case=lower", + target_version=">=6.1", ) def test_ignore_unknown_case(self):