3 new revisions:

Revision: fa02952cd5ef
Branch:   default
Author:   Pekka Klärck
Date:     Wed Sep 18 06:47:36 2013 UTC
Log:      escaping atests: test data format, cleanup
http://code.google.com/p/robotframework/source/detail?r=fa02952cd5ef

Revision: eafc3863c9a4
Branch:   default
Author:   Pekka Klärck
Date:     Wed Sep 18 07:45:56 2013 UTC
Log:      Fixed \U escape with values out of the valid range....
http://code.google.com/p/robotframework/source/detail?r=eafc3863c9a4

Revision: ee329470d1cc
Branch:   default
Author:   Pekka Klärck
Date:     Wed Sep 18 07:46:39 2013 UTC
Log:      Acceptance tests for \x, \u and \U escapes....
http://code.google.com/p/robotframework/source/detail?r=ee329470d1cc

==============================================================================
Revision: fa02952cd5ef
Branch:   default
Author:   Pekka Klärck
Date:     Wed Sep 18 06:47:36 2013 UTC
Log:      escaping atests: test data format, cleanup
http://code.google.com/p/robotframework/source/detail?r=fa02952cd5ef

Added:
 /atest/testdata/parsing/escaping.txt
Deleted:
 /atest/testdata/parsing/escaping.html
Modified:
 /atest/robot/parsing/escaping.txt

=======================================
--- /dev/null
+++ /atest/testdata/parsing/escaping.txt        Wed Sep 18 06:47:36 2013 UTC
@@ -0,0 +1,128 @@
+*** Setting ***
+Variables         escaping_variables.py
+
+*** Variable ***
+${MY SPACE}       \ \
+${TWO SPACES}     ${MY SPACE}${MY 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 ***
+Spaces In Variable Table
+    Should Be Equal    ${MY SPACE}    ${SP}
+    Should Be Equal    ${MY SPACE}${MY SPACE}    ${SP}${SP}
+    Should Be Equal    ${MY SPACE * 3}    ${SP}${SP}${SP}
+    Should Be Equal    ${TWO SPACES}    ${SP}${SP}
+    Should Be Equal    ${FOUR SPACES}    ${SP}${SP}${SP}${SP}
+    Should Be True    len('${FOUR SPACES}') == 4
+    Should Be Equal    "\n ${FOUR SPACES}"    "${NL}${SP}${SP}${SP}${SP}"
+
+Leading And Trailing Spaces In Variable Table
+    Should Be Equal    ${PRE SPACES}    ${SP}${SP}two leading spaces
+    Should Be Equal    ${POST SPACES}    seven trailing spaces${SP*7}
+ Should Be Equal ${POST SPACES}${PRE SPACES} seven trailing spaces${SP*9}two leading spaces
+
+Backslash In Variable Table
+    Should Be Equal    ${BACKSLASH}    c:${BS}temp${BS}new${BS}
+    Should Be Equal    ${BACKSLASH}${BS}${BS}    c:${BS}temp${BS}new${BS*3}
+ Should Be Equal ${BACKSLASH}${PRE SPACES} c:${BS}temp${BS}new${BS}${SP*2}two leading spaces
+    Should Be Equal    ${BACKSLASH 2}    c:${TAB}emp${NL}ew
+
+Newline, Tab And Carriage Return In Variable Table
+    Should Be Equal    ${NEWLINE}    ${NL}
+    Should Be Equal    ${TABULATOR}    ${TAB}
+    Should Be Equal    ${CARRIAGE}    ${CR}
+    Should Be Equal    ${NL TAB CR}    ${NL*2}${TAB*2}${CR*2}
+    Should Be Equal    ${SP}${NEWLINE}    ${SP}${NL}
+
+Escaping Variables In Variable Table
+    Should Be Equal    ${NOT VAR}    \${whatever}
+    Should Be Equal    ${NOT VAR 2}    \${whatever}
+    Should Be Equal    \\${NOT VAR}    \\\${whatever}
+    Should Be Equal    \\${NOT VAR 2}    \\\${whatever}
+    Should Start With    \${NOT VAR}    ${NOT VAR
+
+Escaping From List Variable In variable Table
+    Should Be Equal    @{LIST}[0]    ${SP}
+    Should Be Equal    @{LIST}[1]    c:${BS}temp${BS}
+    Should Be Equal    @{LIST}[2]    ${NL}
+    Should Be Equal    @{LIST}[3]    \${xxx}
+    Should Be Equal    @{LIST}[0]@{LIST}[0]@{LIST}[2]    ${SP}${SP}${NL}
+ Should Be Equal @{LIST}[1]@{LIST}[0]@{LIST}[2] c:${BS}temp${BS}${SP}${NL} + Should Be True @{LIST} == [' ', 'c:\\\\temp\\\\', '\\n', '$'+'{xxx}']
+
+Non Strings Are Ok In variable Table
+    Should Be Equal    ${NON STRING}    ${None}
+
+Remove Spaces Before And After
+    Should Be Equal    foo    foo
+
+Remove Extra Spaces between
+    Should Be Equal    foo bar    foo bar
+
+Escaping Space
+    Should Be Equal    \ \ foo \ \    ${SP*2}foo${SP*2}
+    ${x} =    Set Variable    \ \
+    Should Be Equal    ${x}    ${SP}
+    Should Be Equal    ${x}${x}    ${SP}${SP}
+    Should Be Equal    ${x*4}    ${SP}${SP}${SP}${SP}
+
+Newline
+    Should Be Equal    \n    ${NL}
+    Should Be Equal    \\n    ${NOT NL}
+
+Space After Newline Escape Is Ignored
+    Should Be Equal    foo\n bar\n zap    foo${NL}bar${NL}zap
+    Should Be Equal    foo\n\ bar    foo${NL}${SP}bar
+    Should Be Equal    foo\\n bar    foo${NOT NL}${SP}bar
+
+Carrriage Return
+    Should Be Equal    \r    ${CR}
+    Should Be Equal    \\r    ${NOT CR}
+
+Backslash
+    Should Be Equal    \\    ${BS}
+    Should Be Equal    \foo    foo
+
+Tabulator
+    Should Be Equal    \t    ${TAB}
+
+Hash
+    Should Be Equal    \#    ${HASH}    # This is a comment
+
+Any Character Escaped
+    Should Be Equal    \x    x
+
+Escaping Variables
+    [Documentation]    FAIL Non-existing variable '\${bar}'.
+    Should Be Equal    \${foo}    $\{foo}
+    Should Be Equal    \\${var}    \\\${non_existing}
+    Should Be Equal    \${bar}    ${bar}
+
+Escaping Variables With User Keywords
+    ${ret} =    User Keyword    \${foo}    foo
+    Should Be Equal    ${ret}    \${foo}\${foo}
+    User keyword 2    \${foo}    {foo}
+
+*** Keyword ***
+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}}
=======================================
--- /atest/testdata/parsing/escaping.html       Thu May 27 06:39:53 2010 UTC
+++ /dev/null
@@ -1,2771 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html><head>
-
-
-
-
-
-
-
-
-
-
-
-
-
-  <style type="text/css">
-html {
-  font-family: Arial,Helvetica,sans-serif;
-  background-color: white;
-  color: black;
-}
-p {
-  max-width: 60em;
-}
-table {
-  border-collapse: collapse;
-  empty-cells: show;
-  margin: 1em 0em;
-  border: 0.1em solid black;
-}
-th, td {
-  border-style: solid;
-  border-width: 0.05em 0.1em;
-  border-color: black;
-  padding: 0.1em 0.2em;
-  height: 1.5em;
-}
-th {
-  background-color: rgb(192, 192, 192);
-  color: black;
-  border-width: 0.1em;
-  font-weight: bold;
-  text-align: center;
-  text-transform: capitalize;
-  letter-spacing: 0.1em;
-}
-/* Widths of named columns */
-col.name {
-  width: 10em;
-}
-.action, .value, .arg {
-  width: 15em;
-}
-/* Properties for the name column
-- td:first-child should work in CSS 2.1 avare browsers (tested in Firefox)
-- col.name is against specs but works in IE
-*/
-td:first-child, col.name {
-  background-color: rgb(240, 240, 240);
-  text-transform: capitalize;
-  letter-spacing: 0.1em;
-}
-/* required for IE */
-th {
-  font-style: normal;
-}
-  </style>
-
-
-
-
-
-
-  <title>Robot Test Cases</title></head>
-
-<body>
-
-
-
-
-
-
-
-<h1>Robot Test Cases for Escaping</h1>
-
-
-
-
-
-
-
-
-<table border="1">
-
-
-
-
-
-
-
- <colgroup span="99"><col class="name"><col class="value" span="4"></colgroup>
-  <thead>
-  <tr>
-
-
-
-
-
-
-
-    <th>Setting</th>
-
-
-
-
-
-
-
-    <th>Value</th>
-
-
-
-
-
-
-
-    <th>Value</th>
-
-
-
-
-
-
-
-    <th>value</th>
-
-
-
-
-
-
-
-    <th>Value</th>
-
-
-
-
-
-
-
-  </tr>
-
-
-
-
-
-
-
-  </thead>
-  <tbody>
-
-
-
-
-
-
-
-    <tr>
-
-
-
-
-
-
-
-      <td>Variables</td>
-
-
-
-
-
-
-
-      <td>escaping_variables.py</td>
-
-
-
-
-
-
-
-      <td></td>
-
-
-
-
-
-
-
-      <td></td>
-
-
-
-
-
-
-
-      <td></td>
-
-
-
-
-
-
-
-    </tr>
-
-
-
-
-
-
-
-    <tr>
-
-
-
-
-
-
-
-      <td></td>
-
-
-
-
-
-
-
-      <td></td>
-
-
-
-
-
-
-
-      <td></td>
-
-
-
-
-
-
-
-      <td></td>
-
-
-
-
-
-
-
-      <td></td>
-
-
-
-
-
-
-
-    </tr>
-
-
-
-
-
-
-
-
-
-
-
-
-
-  </tbody>
-</table>
-
-
-
-
-
-
-
-
-<table border="1">
-
-
-
-
-
-
-
- <colgroup span="99"><col class="name"><col class="value" span="4"></colgroup>
-  <thead>
-  <tr>
-
-
-
-
-
-
-
-    <th>Variable</th>
-
-
-
-
-
-
-
-    <th>Value</th>
-
-
-
-
-
-
-
-    <th>Value</th>
-
-
-
-
-
-
-
-    <th>Value</th>
-
-
-
-
-
-
-
-    <th>Value</th>
-
-
-
-
-
-
-
-  </tr>
-
-
-
-
-
-
-
-  </thead>
-  <tbody>
-
-
-
-
-
-
-
-
-
-
-
-
-
-    <tr>
-
-
-
-
-
-
-
-      <td>${SPACE}</td>
-
-
-
-
-
-
-
-      <td>\ \</td>
-
-
-
-
-
-
-
-      <td></td>
-
-
-
-
-
-
-
-      <td></td>
-
-
-
-
-
-
-
-      <td></td>
-
-
-
-
-
-
-
-    </tr>
-
-    <tr>
-
-      <td align="undefined" valign="undefined">${TWO_SPACES}</td>
-
-      <td align="undefined" valign="undefined">${SPACE}${SPACE}</td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-      <td align="undefined" valign="undefined">${FOUR_SPACES}</td>
-      <td align="undefined" valign="undefined">\ \ \ \ \</td>
-      <td align="undefined" valign="undefined"></td>
-      <td align="undefined" valign="undefined"></td>
-      <td align="undefined" valign="undefined"></td>
-    </tr>
-    <tr>
-
-      <td align="undefined" valign="undefined">${PRE_SPACES}</td>
-
-      <td align="undefined" valign="undefined">\ \ two leading spaces</td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-
-      <td align="undefined" valign="undefined">${POST_SPACES}</td>
-
- <td align="undefined" valign="undefined">seven trailing spaces \ \ \ \ \ \ \</td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-
-      <td align="undefined" valign="undefined">${BACKSLASH}</td>
-
-      <td align="undefined" valign="undefined">c:\\temp\\new\\</td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-
-      <td align="undefined" valign="undefined">${BACKSLASH_2}</td>
-
-      <td align="undefined" valign="undefined">c:\temp\new\</td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-
-      <td align="undefined" valign="undefined">${NEWLINE}</td>
-
-      <td align="undefined" valign="undefined">\n</td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-
-      <td align="undefined" valign="undefined">${TABULATOR}</td>
-
-      <td align="undefined" valign="undefined">\t</td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-
-      <td align="undefined" valign="undefined">${CARRIAGE}</td>
-
-      <td align="undefined" valign="undefined">\r</td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-
-      <td align="undefined" valign="undefined">${NL_TAB_CR}</td>
-
- <td align="undefined" valign="undefined">\n${NEWLINE}\t${TABULATOR}\r${CARRIAGE}</td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-
-      <td align="undefined" valign="undefined">${NOT_VAR}</td>
-
-      <td align="undefined" valign="undefined">\${whatever}</td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-
-      <td align="undefined" valign="undefined">${NOT_VAR_2}</td>
-
-      <td align="undefined" valign="undefined">${NOT_VAR}</td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-
-      <td align="undefined" valign="undefined">@{LIST}</td>
-
-      <td align="undefined" valign="undefined">\ \</td>
-
-      <td align="undefined" valign="undefined">c:\\temp\\</td>
-
-      <td align="undefined" valign="undefined">\n</td>
-
-      <td align="undefined" valign="undefined">\${xxx}</td>
-
-    </tr>
-
-    <tr>
-
-      <td align="undefined" valign="undefined">${NON_STRING}</td>
-
-      <td align="undefined" valign="undefined">${None}</td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-
-
-
-
-
-
-
-
-
-
-
-
-  </tbody>
-</table>
-
-
-
-
-
-
-
-
-<table border="1">
-
-
-
-
-
-
-
- <colgroup span="99"><col class="name"><col class="action"><col class="arg" span="3"></colgroup>
-  <thead>
-  <tr>
-
-
-
-
-
-
-
-    <th>Test Case</th>
-
-
-
-
-
-
-
-    <th>Action</th>
-
-
-
-
-
-
-
-    <th>Argument</th>
-
-
-
-
-
-
-
-    <th>Argument</th>
-
-
-
-
-
-
-
-    <th>Argument</th>
-
-
-
-
-
-
-
-
-
-  </tr>
-
-
-
-
-
-
-
-  </thead>
-  <tbody>
-
-
-
-
-
-
-
-    <tr>
-
- <td align="undefined" valign="undefined">Spaces In Variable Table</td>
-
-      <td align="undefined" valign="undefined">Equals</td>
-
-      <td align="undefined" valign="undefined">${SPACE}</td>
-
-      <td align="undefined" valign="undefined">${SP}</td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined">Equals</td>
-
-      <td align="undefined" valign="undefined">${SPACE}${SPACE}</td>
-
-      <td align="undefined" valign="undefined">${SP}${SP}</td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined">Equals</td>
-
-      <td align="undefined" valign="undefined">${SPACE * 3}</td>
-
-      <td align="undefined" valign="undefined">${SP}${SP}${SP}</td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined">Equals</td>
-
-      <td align="undefined" valign="undefined">${TWO_SPACES}</td>
-
-      <td align="undefined" valign="undefined">${SP}${SP}</td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-      <td align="undefined" valign="undefined"></td>
-      <td align="undefined" valign="undefined">Equals</td>
-      <td align="undefined" valign="undefined">${FOUR_SPACES}</td>
-      <td align="undefined" valign="undefined">${SP}${SP}${SP}${SP}</td>
-      <td align="undefined" valign="undefined"></td>
-    </tr>
-    <tr>
-      <td align="undefined" valign="undefined"></td>
-      <td align="undefined" valign="undefined">Fail Unless</td>
- <td align="undefined" valign="undefined">len('${FOUR_SPACES}') == 4</td>
-      <td align="undefined" valign="undefined"></td>
-      <td align="undefined" valign="undefined"></td>
-    </tr>
-    <tr>
-      <td align="undefined" valign="undefined"></td>
-      <td align="undefined" valign="undefined">Equals</td>
-      <td align="undefined" valign="undefined">"\n<br>
-${FOUR_SPACES}"</td>
- <td align="undefined" valign="undefined">"${NL}${SP}${SP}${SP}${SP}"</td>
-      <td align="undefined" valign="undefined"></td>
-    </tr>
-    <tr>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-
- <td align="undefined" valign="undefined">Leading And Trailing Spaces In Variable Table</td>
-
-      <td align="undefined" valign="undefined">Equals</td>
-
-      <td align="undefined" valign="undefined">${PRE_SPACES}</td>
-
- <td align="undefined" valign="undefined">${SP}${SP}two leading spaces</td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined">Equals</td>
-
-      <td align="undefined" valign="undefined">${POST_SPACES}</td>
-
- <td align="undefined" valign="undefined">seven trailing spaces${SP*7}</td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined">Equals</td>
-
- <td align="undefined" valign="undefined">${POST_SPACES}${PRE_SPACES}</td>
-
- <td align="undefined" valign="undefined">seven trailing spaces${SP*9}two leading spaces</td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-
- <td align="undefined" valign="undefined">Backslash In Variable Table</td>
-
-      <td align="undefined" valign="undefined">Equals</td>
-
-      <td align="undefined" valign="undefined">${BACKSLASH}</td>
-
- <td align="undefined" valign="undefined">c:${BS}temp${BS}new${BS}</td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined">Equals</td>
-
-      <td align="undefined" valign="undefined">${BACKSLASH}${BS}${BS}</td>
-
- <td align="undefined" valign="undefined">c:${BS}temp${BS}new${BS*3}</td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined">Equals</td>
-
- <td align="undefined" valign="undefined">${BACKSLASH}${PRE_SPACES}</td>
-
- <td align="undefined" valign="undefined">c:${BS}temp${BS}new${BS}${SP*2}two leading spaces</td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined">Equals</td>
-
-      <td align="undefined" valign="undefined">${BACKSLASH_2}</td>
-
-      <td align="undefined" valign="undefined">c:${TAB}emp${NL}ew</td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-
- <td align="undefined" valign="undefined">Newline, Tab And Carriage Return In Variable Table</td>
-
-      <td align="undefined" valign="undefined">Equals</td>
-
-      <td align="undefined" valign="undefined">${NEWLINE}</td>
-
-      <td align="undefined" valign="undefined">${NL}</td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined">Equals</td>
-
-      <td align="undefined" valign="undefined">${TABULATOR}</td>
-
-      <td align="undefined" valign="undefined">${TAB}</td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined">Equals</td>
-
-      <td align="undefined" valign="undefined">${CARRIAGE}</td>
-
-      <td align="undefined" valign="undefined">${CR}</td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined">Equals</td>
-
-      <td align="undefined" valign="undefined">${NL_TAB_CR}</td>
-
-      <td align="undefined" valign="undefined">${NL*2}${TAB*2}${CR*2}</td>
-
-      <td align="undefined" valign="undefined"></td>
-
-    </tr>
-
-    <tr>
-
-      <td align="undefined" valign="undefined"></td>
-
-      <td align="undefined" valign="undefined">Equals</td>
-
-      <td align="undefined" valign="undefined">${SP}${NEWLINE}</td>
-
-      <td align="undefined" valign="undefined">${SP}${NL}</td>
-
***The diff for this file has been truncated for email.***
=======================================
--- /atest/robot/parsing/escaping.txt   Mon Apr 12 12:17:10 2010 UTC
+++ /atest/robot/parsing/escaping.txt   Wed Sep 18 06:47:36 2013 UTC
@@ -1,72 +1,67 @@
 *** Settings ***
-Suite Setup     Run Tests  ${EMPTY}  parsing${/}escaping.html
+Suite Setup     Run Tests  ${EMPTY}  parsing/escaping.txt
 Force Tags      regression  jybot  pybot
 Resource        atest_resource.txt

 *** Test Cases ***
 Spaces In Variable Table
-    Check Test Case  Spaces In Variable Table
+    Check Test Case    ${TEST NAME}

 Leading And Trailing Spaces In Variable Table
-    Check Test Case  Leading And Trailing Spaces In Variable Table
+    Check Test Case    ${TEST NAME}

 Backslash In Variable Table
-    Check Test Case  Backslash In Variable Table
+    Check Test Case    ${TEST NAME}

 Newline, Tab And Carriage Return In Variable Table
-    Check Test Case  Newline, Tab And Carriage Return In Variable Table
+    Check Test Case    ${TEST NAME}

 Escaping Variables In Variable Table
-    Check Test Case  Escaping Variables In Variable Table
+    Check Test Case    ${TEST NAME}

 Escaping From List Variable In Variable Table
-    Check Test Case  Escaping From List Variable In variable Table
+    Check Test Case    ${TEST NAME}

 Non Strings Are Ok In Variable Table
-    Check Test Case  Non Strings Are Ok In variable Table
+    Check Test Case    ${TEST NAME}

 Remove Spaces Before And After
-    Check Test Case  Remove Spaces Before And After
+    Check Test Case    ${TEST NAME}

 Remove Extra Spaces Between
-    Check Test Case  Remove Extra Spaces between
+    Check Test Case    ${TEST NAME}

 Escaping Space
-    Check Test Case  Escaping Space
-
-Literal Newline Is Converted To Space
-    Check Test Case  Literal Newline Is Converted to Space
-
-Literal Newline After Newline Escape Is Ignored
-    Check Test Case  Literal newline after Newline Escape Is Ignored
+    Check Test Case    ${TEST NAME}

 New Line
-    Check Test Case  New Line
+    Check Test Case    ${TEST NAME}

-New Line And Space
-    Check Test Case  New Line And Space
+Space After Newline Escape Is Ignored
+    Check Test Case    ${TEST NAME}

 Carrriage Return
-    Check Test Case  Carrriage Return
+    Check Test Case    ${TEST NAME}

 Backslash
-    Check Test Case  Backslash
+    Check Test Case    ${TEST NAME}

 Tabulator
-    Check Test Case  Tabulator
+    Check Test Case    ${TEST NAME}

 Hash
-    Check Test Case  Hash
+    Check Test Case    ${TEST NAME}

 Any Character Escaped
-    Check Test Case  Any Character Escaped
+    Check Test Case    ${TEST NAME}

 Escaping Variables
-    Check Test Case  Escaping Variables
+    Check Test Case    ${TEST NAME}

 Escaping Variables With User Keywords
-    Check Test Case  Escaping Variables With User Keywords
+    Check Test Case    ${TEST NAME}

 No Errors Should Have Occurred
-    Fail Unless File Empty  ${STDERR_FILE}
+    Should Be Empty    ${ERRORS}
+    File Should Be Empty    ${STDERR_FILE}


==============================================================================
Revision: eafc3863c9a4
Branch:   default
Author:   Pekka Klärck
Date:     Wed Sep 18 07:45:56 2013 UTC
Log:      Fixed \U escape with values out of the valid range.

Update issue 1524
Fixed handling \U escape when value is too big.
http://code.google.com/p/robotframework/source/detail?r=eafc3863c9a4

Modified:
 /src/robot/utils/escaping.py
 /utest/utils/test_escaping.py

=======================================
--- /src/robot/utils/escaping.py        Tue Sep 17 14:44:32 2013 UTC
+++ /src/robot/utils/escaping.py        Wed Sep 18 07:45:56 2013 UTC
@@ -81,10 +81,9 @@
     def _unescape_character(self, text, length, escape):
         try:
             ordinal = self._get_ordinal(text, length)
-        except ValueError:
+            return unichr(ordinal) + text[length:]
+        except (ValueError, OverflowError):
             return escape + text
-        else:
-            return unichr(ordinal) + text[length:]

     def _get_ordinal(self, text, length):
         if len(text) < length:
=======================================
--- /utest/utils/test_escaping.py       Tue Sep 17 14:44:32 2013 UTC
+++ /utest/utils/test_escaping.py       Wed Sep 18 07:45:56 2013 UTC
@@ -110,6 +110,10 @@
                          (r'\U000000e4iti', u'\xe4iti')]:
             assert_unescape(inp, exp)

+    def test_U_above_valid_range(self):
+        assert_unescape(r'\U12345678', 'U12345678')
+        assert_unescape(r'\UffffFFFF', 'UffffFFFF')
+

 class TestEscape(unittest.TestCase):


==============================================================================
Revision: ee329470d1cc
Branch:   default
Author:   Pekka Klärck
Date:     Wed Sep 18 07:46:39 2013 UTC
Log:      Acceptance tests for \x, \u and \U escapes.

Update issue 1524
Acceptance tests for \x, \u and \U.
http://code.google.com/p/robotframework/source/detail?r=ee329470d1cc

Modified:
 /atest/robot/parsing/escaping.txt
 /atest/testdata/parsing/escaping.txt
 /atest/testdata/parsing/escaping_variables.py

=======================================
--- /atest/robot/parsing/escaping.txt   Wed Sep 18 06:47:36 2013 UTC
+++ /atest/robot/parsing/escaping.txt   Wed Sep 18 07:46:39 2013 UTC
@@ -33,6 +33,9 @@

 Escaping Space
     Check Test Case    ${TEST NAME}
+
+Backslash
+    Check Test Case    ${TEST NAME}

 New Line
     Check Test Case    ${TEST NAME}
@@ -43,10 +46,28 @@
 Carrriage Return
     Check Test Case    ${TEST NAME}

-Backslash
+Tabulator
+    Check Test Case    ${TEST NAME}
+
+Valid \x Escape
+    Check Test Case    ${TEST NAME}
+
+Invalid \x Escape
+    Check Test Case    ${TEST NAME}
+
+Valid \u Escape
+    Check Test Case    ${TEST NAME}
+
+Invalid \u Escape
+    Check Test Case    ${TEST NAME}
+
+Valid \U (32bit) Escape
+    Check Test Case    ${TEST NAME}
+
+Invalid \U (32bit) Escape
     Check Test Case    ${TEST NAME}

-Tabulator
+\U (32bit) Escape Above Valid Range
     Check Test Case    ${TEST NAME}

 Hash
=======================================
--- /atest/testdata/parsing/escaping.txt        Wed Sep 18 06:47:36 2013 UTC
+++ /atest/testdata/parsing/escaping.txt        Wed Sep 18 07:46:39 2013 UTC
@@ -77,6 +77,10 @@
     Should Be Equal    ${x}    ${SP}
     Should Be Equal    ${x}${x}    ${SP}${SP}
     Should Be Equal    ${x*4}    ${SP}${SP}${SP}${SP}
+
+Backslash
+    Should Be Equal    \\    ${BS}
+    Should Be Equal    \foo    foo

 Newline
     Should Be Equal    \n    ${NL}
@@ -90,13 +94,53 @@
 Carrriage Return
     Should Be Equal    \r    ${CR}
     Should Be Equal    \\r    ${NOT CR}
-
-Backslash
-    Should Be Equal    \\    ${BS}
-    Should Be Equal    \foo    foo

 Tabulator
     Should Be Equal    \t    ${TAB}
+
+Valid \x Escape
+    Should Be Equal    \x00    ${x00}
+    Should Be Equal    \x09\x0A\x0d    \t\n\r
+    Should Be Equal    \xe4    ${xE4}
+    Should Be Equal    \xFF    ${xFF}
+    Should Be Equal    \x50\xf6\x6cj\xE4    Pöljä
+    Log    Bytes 0-10: "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A"
+
+Invalid \x Escape
+    Should Be Equal    \x    x
+    Should Be Equal    xx\xxx    xxxxx
+    Should Be Equal    \x0    x0
+
+Valid \u Escape
+    Should Be Equal    \u0000    ${x00}
+    Should Be Equal    \u00e4    ${xE4}
+    Should Be Equal    \u00FF    ${xFF}
+    Should Be Equal    \u2603    ${u2603}
+    Should Be Equal    \uFfFf    ${uFFFF}
+    Should Be Equal    \u0050\u00f6\x6cj\u00E4    Pöljä
+    Log    Snowman: \u2603
+
+Invalid \u Escape
+    Should Be Equal    \u    u
+    Should Be Equal    uuuu\uuuuu    uuuuuuuuu
+    Should Be Equal    \u123    u123
+
+Valid \U (32bit) Escape
+    Should Be Equal    \U00000000    ${x00}
+    Should Be Equal    \U000000e4    ${xE4}
+    Should Be Equal    \U00002603    ${u2603}
+    Should Be Equal    \U00010905    ${u00010905}
+    Should Be Equal    \U00000050\u00f6\x6cj\U000000E4    Pöljä
+    Log    Phoenician letter wau: \U00010905
+
+Invalid \U (32bit) Escape
+    Should Be Equal    \U    U
+    Should Be Equal    \UUUUUUUUU    UUUUUUUUU
+    Should Be Equal    \U0000123    U0000123
+
+\U (32bit) Escape Above Valid Range
+    Should Be Equal    \U12345678   U12345678
+    Should Be Equal    \UffffFFFF   UffffFFFF

 Hash
     Should Be Equal    \#    ${HASH}    # This is a comment
=======================================
--- /atest/testdata/parsing/escaping_variables.py Wed Aug 12 13:24:22 2009 UTC +++ /atest/testdata/parsing/escaping_variables.py Wed Sep 18 07:46:39 2013 UTC
@@ -2,9 +2,15 @@
 tab = '\t'
 hash = '#'
 nl = '\n'
-notnl ='\\n'
+not_nl = '\\n'
 cr = '\r'
-notcr ='\\r'
+not_cr = '\\r'
+x00 = '\x00'
+xE4 = u'\xE4'
+xFF = u'\xFF'
+u2603 = u'\u2603'  # SNOWMAN
+uFFFF = u'\uFFFF'
+U00010905 = u'\U00010905'  # PHOENICIAN LETTER WAU
 bs = '\\'
 var = '${non_existing}'
 pipe = '|'

--

--- You received this message because you are subscribed to the Google Groups "robotframework-commit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to robotframework-commit+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to