All Downloads are FREE. Search and download functionalities are using the official Maven repository.

robotframework-2.7.7.atest.testdata.parsing.escaping.html Maven / Gradle / Ivy

The newest version!









  
  
  
  
  
  
  
  
  
  
  
  
  
  Robot Test Cases









Robot Test Cases for Escaping

Setting Value Value value Value
Variables escaping_variables.py
Variable Value Value Value Value
${SPACE} \ \
${TWO_SPACES} ${SPACE}${SPACE}
${FOUR_SPACES} \ \ \ \ \
${PRE_SPACES} \ \ two leading spaces
${POST_SPACES} seven trailing spaces \ \ \ \ \ \ \
${BACKSLASH} c:\\temp\\new\\
${BACKSLASH_2} c:\temp\new\
${NEWLINE} \n
${TABULATOR} \t
${CARRIAGE} \r
${NL_TAB_CR} \n${NEWLINE}\t${TABULATOR}\r${CARRIAGE}
${NOT_VAR} \${whatever}
${NOT_VAR_2} ${NOT_VAR}
@{LIST} \ \ c:\\temp\\ \n \${xxx}
${NON_STRING} ${None}
Test Case Action Argument Argument Argument
Spaces In Variable Table Equals ${SPACE} ${SP}
Equals ${SPACE}${SPACE} ${SP}${SP}
Equals ${SPACE * 3} ${SP}${SP}${SP}
Equals ${TWO_SPACES} ${SP}${SP}
Equals ${FOUR_SPACES} ${SP}${SP}${SP}${SP}
Fail Unless len('${FOUR_SPACES}') == 4
Equals "\n
${FOUR_SPACES}"
"${NL}${SP}${SP}${SP}${SP}"
Leading And Trailing Spaces In Variable Table Equals ${PRE_SPACES} ${SP}${SP}two leading spaces
Equals ${POST_SPACES} seven trailing spaces${SP*7}
Equals ${POST_SPACES}${PRE_SPACES} seven trailing spaces${SP*9}two leading spaces
Backslash In Variable Table Equals ${BACKSLASH} c:${BS}temp${BS}new${BS}
Equals ${BACKSLASH}${BS}${BS} c:${BS}temp${BS}new${BS*3}
Equals ${BACKSLASH}${PRE_SPACES} c:${BS}temp${BS}new${BS}${SP*2}two leading spaces
Equals ${BACKSLASH_2} c:${TAB}emp${NL}ew
Newline, Tab And Carriage Return In Variable Table Equals ${NEWLINE} ${NL}
Equals ${TABULATOR} ${TAB}
Equals ${CARRIAGE} ${CR}
Equals ${NL_TAB_CR} ${NL*2}${TAB*2}${CR*2}
Equals ${SP}${NEWLINE} ${SP}${NL}
Escaping Variables In Variable Table Equals ${NOT_VAR} \${whatever}
Equals ${NOT_VAR_2} \${whatever}
Equals \\${NOT_VAR} \\\${whatever}
Equals \\${NOT_VAR_2} \\\${whatever}
Starts \${NOT_VAR} ${NOT_VAR
Escaping From List Variable In variable Table Equals @{LIST}[0] ${SP}
Equals @{LIST}[1] c:${BS}temp${BS}
Equals @{LIST}[2] ${NL}
Equals @{LIST}[3] \${xxx}
Equals @{LIST}[0]@{LIST}[0]@{LIST}[2] ${SP}${SP}${NL}
Equals @{LIST}[1]@{LIST}[0]@{LIST}[2] c:${BS}temp${BS}${SP}${NL}
Fail Unless @{LIST} == [' ', 'c:\\\\temp\\\\', '\\n', '$'+'{xxx}']
Non Strings Are Ok In variable Table Equals ${NON_STRING} ${None}
Remove Spaces Before And After Equals   foo   foo
Remove Extra Spaces between Equals foo     bar foo bar
Escaping Space Equals \ \ foo \ \ ${SP*2}foo${SP*2}
${x} = Set \ \
Equals ${x} ${SP}
Equals ${x}${x} ${SP}${SP}
Equals ${x *4} ${SP}${SP}${SP}${SP}
Literal Newline Is Converted to Space Equals foo
bar
foo bar
Equals foo
   bar
foo bar
Literal newline after Newline Escape Is Ignored Equals foo\n
bar\n
zap
foo\nbar\nzap
Newline Equals \n ${NL}
Equals \\n ${NOT_NL}
Newline And Space Equals foo\n bar foo${NL}bar
Equals foo\n\ bar foo${NL}${SP}bar
Carrriage Return Equals \r ${CR}
Equals \\r ${NOT_CR}
Backslash Equals \\ ${BS}
Equals \foo foo
Tabulator Equals \t ${TAB}
Hash Equals \# ${HASH} # This is a comment
Any Character Escaped Equals \x x
Escaping Variables [Document] FAIL Non-existing variable '\${bar}'.
Equals \${foo} $\{foo}
Equals \\${var} \\\${non_existing}
Equals \${bar} ${bar}
Escaping Variables With User Keywords${ret} =User Keyword\${foo}
foo
Should Be Equal${ret}\${foo}\${foo}
User keyword 2\${foo}{foo}
Keyword Action Argument Argument Argument
User keyword [Arguments] ${a1} ${a2}
Should Contain${a1}${a2}
[Return]${a1}\${${a2}}
User keyword 2[Arguments]${a1}${a2}
Should Be Equal${a1}$${a2}
${ret} =User Keyword${a1}${a2}
Should Be Equal${ret}${a1}\${${a2}}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy