6 new revisions:

Revision: e4126914d5b5
Branch:   default
Author:   Robot Framework Developers (robotframew...@gmail.com)
Date:     Thu Oct 10 11:32:24 2013 UTC
Log:      More fixes to \x, \u and \U escapes....
http://code.google.com/p/robotframework/source/detail?r=e4126914d5b5

Revision: cf6f60454481
Branch:   default
Author:   Robot Framework Developers (robotframew...@gmail.com)
Date:     Thu Oct 10 13:24:53 2013 UTC
Log:      Automated merge with https://robotframework.googlecode.com/hg/
http://code.google.com/p/robotframework/source/detail?r=cf6f60454481

Revision: 3738bc67b1a8
Branch:   default
Author:   Robot Framework Developers (robotframew...@gmail.com)
Date:     Thu Oct 10 15:25:13 2013 UTC
Log:      fixed doc bugs
http://code.google.com/p/robotframework/source/detail?r=3738bc67b1a8

Revision: fea3fcbc74b4
Branch:   default
Author:   Robot Framework Developers (robotframew...@gmail.com)
Date:     Thu Oct 10 15:28:30 2013 UTC
Log:      UG: Small fixes/enhancements to test data syntax section....
http://code.google.com/p/robotframework/source/detail?r=fea3fcbc74b4

Revision: ccb465979bcb
Branch:   default
Author:   Robot Framework Developers (robotframew...@gmail.com)
Date:     Thu Oct 10 15:29:10 2013 UTC
Log:      regen
http://code.google.com/p/robotframework/source/detail?r=ccb465979bcb

Revision: cb069817e2ef
Branch:   default
Author:   Robot Framework Developers (robotframew...@gmail.com)
Date:     Thu Oct 10 15:29:18 2013 UTC
Log:      Automated merge with https://robotframework.googlecode.com/hg/
http://code.google.com/p/robotframework/source/detail?r=cb069817e2ef

==============================================================================
Revision: e4126914d5b5
Branch:   default
Author:   Robot Framework Developers (robotframew...@gmail.com)
Date:     Thu Oct 10 11:32:24 2013 UTC
Log:      More fixes to \x, \u and \U escapes.

Update issue 1524
- Fixed handling \ä.
- Fixed atests with narrow builds (now \U00010905 works).
- Small enhancements to atests.
http://code.google.com/p/robotframework/source/detail?r=e4126914d5b5

Modified:
 /atest/testdata/parsing/escaping.txt
 /atest/testdata/parsing/escaping_variables.py
 /src/robot/utils/escaping.py
 /utest/utils/test_escaping.py

=======================================
--- /atest/testdata/parsing/escaping.txt        Wed Sep 18 07:46:39 2013 UTC
+++ /atest/testdata/parsing/escaping.txt        Thu Oct 10 11:32:24 2013 UTC
@@ -84,19 +84,20 @@

 Newline
     Should Be Equal    \n    ${NL}
-    Should Be Equal    \\n    ${NOT NL}
+    Should Be Equal    \\n    ${BS}n

 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
+    Should Be Equal    foo\\n bar    foo${BS}n${SP}bar

 Carrriage Return
     Should Be Equal    \r    ${CR}
-    Should Be Equal    \\r    ${NOT CR}
+    Should Be Equal    \\r    ${BS}r

 Tabulator
     Should Be Equal    \t    ${TAB}
+    Should Be Equal    \\t    ${BS}t

 Valid \x Escape
     Should Be Equal    \x00    ${x00}
@@ -108,6 +109,8 @@

 Invalid \x Escape
     Should Be Equal    \x    x
+    Should Be Equal    \x+1    x+1
+    Should Be Equal    \\x00    ${BS}x00
     Should Be Equal    xx\xxx    xxxxx
     Should Be Equal    \x0    x0

@@ -122,6 +125,8 @@

 Invalid \u Escape
     Should Be Equal    \u    u
+    Should Be Equal    \u+123    u+123
+    Should Be Equal    \\u1234    ${BS}u1234
     Should Be Equal    uuuu\uuuuu    uuuuuuuuu
     Should Be Equal    \u123    u123

@@ -129,24 +134,32 @@
     Should Be Equal    \U00000000    ${x00}
     Should Be Equal    \U000000e4    ${xE4}
     Should Be Equal    \U00002603    ${u2603}
-    Should Be Equal    \U00010905    ${u00010905}
+    Should Be Equal    \U00010905    ${U00010905}
+    Should Be Equal    \U0010FFFF    ${U0010FFFF}
     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    \U+0001234    U+0001234
+    Should Be Equal    \\U00012345    ${BS}U00012345
     Should Be Equal    \UUUUUUUUU    UUUUUUUUU
+    Should Be Equal    \U0000123x    U0000123x
     Should Be Equal    \U0000123    U0000123

 \U (32bit) Escape Above Valid Range
-    Should Be Equal    \U12345678   U12345678
-    Should Be Equal    \UffffFFFF   UffffFFFF
+    Should Be Equal    \U00110000    U00110000
+    Should Be Equal    \U12345678    U12345678
+    Should Be Equal    \UffffFFFF    UffffFFFF

 Hash
     Should Be Equal    \#    ${HASH}    # This is a comment

 Any Character Escaped
+    Should Be Equal    \0    0
+    Should Be Equal    \a    a
     Should Be Equal    \x    x
+    Should Be Equal    \ä    ä

 Escaping Variables
     [Documentation]    FAIL Non-existing variable '\${bar}'.
=======================================
--- /atest/testdata/parsing/escaping_variables.py Wed Sep 18 09:01:36 2013 UTC +++ /atest/testdata/parsing/escaping_variables.py Thu Oct 10 11:32:24 2013 UTC
@@ -1,19 +1,15 @@
 sp = ' '
+hash = '#'
+bs = '\\'
 tab = '\t'
-hash = '#'
 nl = '\n'
-not_nl = '\\n'
 cr = '\r'
-not_cr = '\\r'
 x00 = '\x00'
 xE4 = u'\xE4'
 xFF = u'\xFF'
 u2603 = u'\u2603'  # SNOWMAN
 uFFFF = u'\uFFFF'
-try:
-    U00010905 = unichr(int('00010905', 16))  # PHOENICIAN LETTER WAU
-except ValueError:  # occurs on "narrow" Python builds
-    U00010905 = 'U00010905'
-bs = '\\'
+U00010905 = u'\U00010905'  # PHOENICIAN LETTER WAU
+U0010FFFF = u'\U0010FFFF'  # Biggest valid Unicode character
 var = '${non_existing}'
 pipe = '|'
=======================================
--- /src/robot/utils/escaping.py        Thu Oct 10 09:50:02 2013 UTC
+++ /src/robot/utils/escaping.py        Thu Oct 10 11:32:24 2013 UTC
@@ -52,7 +52,11 @@

     def _unescape(self, text):
         try:
-            unescaper = getattr(self, '_unescaper_for_' + text[0])
+            escape = str(text[0])
+        except UnicodeError:
+            return text
+        try:
+            unescaper = getattr(self, '_unescaper_for_' + escape)
         except AttributeError:
             return text
         else:
=======================================
--- /utest/utils/test_escaping.py       Thu Oct 10 09:50:02 2013 UTC
+++ /utest/utils/test_escaping.py       Thu Oct 10 11:32:24 2013 UTC
@@ -21,6 +21,9 @@
                          ('\\ ', ' '),
                          ('a\\', 'a'),
                          ('\\a', 'a'),
+                         ('\\-', u'-'),
+                         (u'\\\xe4', u'\xe4'),
+                         ('\\0', '0'),
                          ('a\\b\\c\\d', 'abcd')]:
             assert_unescape(inp, exp)


==============================================================================
Revision: cf6f60454481
Branch:   default
Author:   Robot Framework Developers (robotframew...@gmail.com)
Date:     Thu Oct 10 13:24:53 2013 UTC
Log:      Automated merge with https://robotframework.googlecode.com/hg/
http://code.google.com/p/robotframework/source/detail?r=cf6f60454481



==============================================================================
Revision: 3738bc67b1a8
Branch:   default
Author:   Robot Framework Developers (robotframew...@gmail.com)
Date:     Thu Oct 10 15:25:13 2013 UTC
Log:      fixed doc bugs
http://code.google.com/p/robotframework/source/detail?r=3738bc67b1a8

Modified:
 /doc/userguide/src/CreatingTestData/Variables.rst

=======================================
--- /doc/userguide/src/CreatingTestData/Variables.rst Tue Oct 8 11:21:56 2013 UTC +++ /doc/userguide/src/CreatingTestData/Variables.rst Thu Oct 10 15:25:13 2013 UTC
@@ -613,13 +613,13 @@
| | started from. | +------------+------------------------------------------------------------------+ | ${/} | The system directory path separator. :code:`/` in UNIX-like | - | | systems, :code:`\\` in Windows. | + | | systems and :code:`\\` in Windows. | +------------+------------------------------------------------------------------+ | ${:} | The system path element separator. :code:`:` in UNIX-like | | | systems and :code:`;` in Windows. | +------------+------------------------------------------------------------------+ | ${\\n} | The system line separator. :code:`\\n` in UNIX-like systems and | - | | systems and :code:`\\r\\n` in Windows. New in version 2.7.5. | + | | :code:`\\r\\n` in Windows. New in version 2.7.5. | +------------+------------------------------------------------------------------+

 .. table:: Using operating-system-related built-in variables

==============================================================================
Revision: fea3fcbc74b4
Branch:   default
Author:   Robot Framework Developers (robotframew...@gmail.com)
Date:     Thu Oct 10 15:28:30 2013 UTC
Log:      UG: Small fixes/enhancements to test data syntax section.

Update issue 1524
Status: Review
Proofread the docs and enhanced them slightly. Someone else should still take
a look at the docs but otherwise this issue ought to be done.
http://code.google.com/p/robotframework/source/detail?r=fea3fcbc74b4

Modified:
 /doc/userguide/src/CreatingTestData/TestDataSyntax.rst

=======================================
--- /doc/userguide/src/CreatingTestData/TestDataSyntax.rst Wed Oct 9 13:10:58 2013 UTC +++ /doc/userguide/src/CreatingTestData/TestDataSyntax.rst Thu Oct 10 15:28:30 2013 UTC
@@ -608,8 +608,8 @@
 This is done to avoid hard-to-debug errors
 when a non-breaking space is accidentally used instead of a normal space.

-If leading, trailing, or consecutive spaces are needed, they must either be
-escaped__. Newlines, carriage returns, tabs, and non-breaking spaces can be
+If leading, trailing, or consecutive spaces are needed, they `must be
+escaped`__. Newlines, carriage returns, tabs, and non-breaking spaces can be created using `escape sequences`_ :code:`\\n`, :code:`\\r`, :code:`\\t`, and
 :code:`\\xA0` respectively.

@@ -618,9 +618,9 @@
 Escaping
 ''''''''

-The escape character in Robot Framework test data is the backslash (:code:`\\`), +The escape character in Robot Framework test data is the backslash (:code:`\\`)
 and additionally `built-in variables`_ :var:`${EMPTY}` and :var:`${SPACE}`
-are often used for escaping. Different escaping mechanisms are
+can often be used for escaping. Different escaping mechanisms are
 discussed in the sections below.

 Escaping special characters
@@ -641,7 +641,7 @@
:code:`\\#` Hash sign, never starts a comment_. :code:`\\# not comment` :code:`\\=` Equal sign, never part of `named argument syntax`_. :code:`not\\=named` :code:`\\|` Pipe character, not a separator in the `pipe separated format`_. :code:`| Run | ps \\| grep xxx |` - :code:`\\\\` Backlash character, never escapes anything. :code:`c:\\\\temp, \\\\${var}` + :code:`\\\\` Backslash character, never escapes anything. :code:`c:\\\\temp, \\\\${var}` ============ ================================================================ =================================

 .. _escape sequence:
@@ -660,16 +660,31 @@
=================== ========================================== ================================== Sequence Meaning Examples =================== ========================================== ================================== - :code:`\\n` Newline character. :code:`first line\\n2nd line`. - :code:`\\r` Carriage return character :code:`text\\rmore text`. - :code:`\\t` Tab character. :code:`text\\tmore text`. - :code:`\\xhh` Character with hex value :code:`hh`. :code:`null byte: \\x00, ä: \\xe4` + :code:`\\n` Newline character. :code:`first line\\n2nd line` + :code:`\\r` Carriage return character :code:`text\\rmore text` + :code:`\\t` Tab character. :code:`text\\tmore text` + :code:`\\xhh` Character with hex value :code:`hh`. :code:`null byte: \\x00, ä: \\xE4` :code:`\\uhhhh` Character with hex value :code:`hhhh`. :code:`snowman: \\u2603` :code:`\\Uhhhhhhhh` Character with hex value :code:`hhhhhhhh`. :code:`love hotel: \\U0001f3e9` =================== ========================================== ==================================

-.. note:: :code:`\\x`, :code:`\\u` and :code:`\\U` escape sequences are new in
-          Robot Framework 2.8.2.
+.. note:: All strings created in the test data, including characters like
+          :code:`\\x02`, are Unicode and must be explicitly converted to
+          byte strings if needed. This can be done, for example, using
+          :name:`Encode String To Bytes` keyword in the String_ library or
+ something like :code:`str(value)` or :code:`value.encode('UTF-8')`
+          in Python code.
+
+.. note:: If invalid hexadecimal values are used with :code:`\\x`, :code:`\\u` + or :code:`\\U` escapes, the end result is the original value without
+          the backslash character. For example, :code:`\\xAX` (not hex) and
+          :code:`\\U00110000` (too large value) result with :code:`xAX`
+          and :code:`U00110000`, respectively. This behavior may change in
+          the future, though.
+
+.. note:: `Built-in variable`_ :var:`${\\n}` can be used if operating system + dependent line terminator is needed (:code:`\\r\\n` on Windows and
+          :code:`\\n` elsewhere).

 .. note:: Possible un-escaped whitespace character after the :code:`\\n` is
           ignored. This means that :code:`two lines\\nhere` and
@@ -679,6 +694,9 @@
           An exception to this rule is that the whitespace character is not
           ignored inside the `extended variable syntax`_.

+.. note:: :code:`\\x`, :code:`\\u` and :code:`\\U` escape sequences are new in
+          Robot Framework 2.8.2.
+
 Prevent ignoring empty cells
 ````````````````````````````

@@ -691,8 +709,8 @@
 `built-in variable`_ :var:`${EMPTY}`. The latter is typically recommended
as it is easier to understand. An exception to this recommendation is escaping
 the indented cells in `for loops`_ with a backslash when using the
-`space separated format`_. All this is illustrated in the following examples
-first in HTML and then in the space separated plain text format:
+`space separated format`_. All these cases are illustrated in the following
+examples first in HTML and then in the space separated plain text format:

 .. table::
    :class: example

==============================================================================
Revision: ccb465979bcb
Branch:   default
Author:   Robot Framework Developers (robotframew...@gmail.com)
Date:     Thu Oct 10 15:29:10 2013 UTC
Log:      regen
http://code.google.com/p/robotframework/source/detail?r=ccb465979bcb

Modified:
 /doc/userguide/RobotFrameworkUserGuide.html

=======================================
--- /doc/userguide/RobotFrameworkUserGuide.html Wed Oct  9 13:11:32 2013 UTC
+++ /doc/userguide/RobotFrameworkUserGuide.html Thu Oct 10 15:29:10 2013 UTC
@@ -2236,16 +2236,16 @@
<p>In addition to that, non-breaking spaces are replaced with normal spaces.
 This is done to avoid hard-to-debug errors
when a non-breaking space is accidentally used instead of a normal space.</p> -<p>If leading, trailing, or consecutive spaces are needed, they must either be -<a class="reference internal" href="#prevent-ignoring-spaces">escaped</a>. Newlines, carriage returns, tabs, and non-breaking spaces can be +<p>If leading, trailing, or consecutive spaces are needed, they <a class="reference internal" href="#prevent-ignoring-spaces">must be +escaped</a>. Newlines, carriage returns, tabs, and non-breaking spaces can be created using <a class="reference internal" href="#escape-sequences">escape sequences</a> <span class="code">\n</span>, <span class="code">\r</span>, <span class="code">\t</span>, and
 <span class="code">\xA0</span> respectively.</p>
 </div>
 <div class="section" id="escaping">
 <h4><a class="toc-backref" href="#id413">Escaping</a></h4>
-<p>The escape character in Robot Framework test data is the backslash (<span class="code">\</span>), +<p>The escape character in Robot Framework test data is the backslash (<span class="code">\</span>) and additionally <a class="reference internal" href="#built-in-variables">built-in variables</a> <span class="var">${EMPTY}</span> and <span class="var">${SPACE}</span>
-are often used for escaping. Different escaping mechanisms are
+can often be used for escaping. Different escaping mechanisms are
 discussed in the sections below.</p>
 <div class="section" id="escaping-special-characters">
 <h5>Escaping special characters</h5>
@@ -2290,7 +2290,7 @@
 <td><span class="code">| Run | ps \| grep xxx |</span></td>
 </tr>
 <tr><td><span class="code">\\</span></td>
-<td>Backlash character, never escapes anything.</td>
+<td>Backslash character, never escapes anything.</td>
 <td><span class="code">c:\\temp, \\${var}</span></td>
 </tr>
 </tbody>
@@ -2317,19 +2317,19 @@
 <tbody valign="top">
 <tr><td><span class="code">\n</span></td>
 <td>Newline character.</td>
-<td><span class="code">first line\n2nd line</span>.</td>
+<td><span class="code">first line\n2nd line</span></td>
 </tr>
 <tr><td><span class="code">\r</span></td>
 <td>Carriage return character</td>
-<td><span class="code">text\rmore text</span>.</td>
+<td><span class="code">text\rmore text</span></td>
 </tr>
 <tr><td><span class="code">\t</span></td>
 <td>Tab character.</td>
-<td><span class="code">text\tmore text</span>.</td>
+<td><span class="code">text\tmore text</span></td>
 </tr>
 <tr><td><span class="code">\xhh</span></td>
 <td>Character with hex value <span class="code">hh</span>.</td>
-<td><span class="code">null byte: \x00, ä: \xe4</span></td>
+<td><span class="code">null byte: \x00, ä: \xE4</span></td>
 </tr>
 <tr><td><span class="code">\uhhhh</span></td>
 <td>Character with hex value <span class="code">hhhh</span>.</td>
@@ -2343,8 +2343,27 @@
 </table>
 <div class="note">
 <p class="first admonition-title">Note</p>
-<p class="last"><span class="code">\x</span>, <span class="code">\u</span> and <span class="code">\U</span> escape sequences are new in
-Robot Framework 2.8.2.</p>
+<p class="last">All strings created in the test data, including characters like +<span class="code">\x02</span>, are Unicode and must be explicitly converted to
+byte strings if needed. This can be done, for example, using
+<span class="name">Encode String To Bytes</span> keyword in the <a class="reference external" href="../libraries/String.html">String</a> library or +something like <span class="code">str(value)</span> or <span class="code">value.encode('UTF-8')</span>
+in Python code.</p>
+</div>
+<div class="note">
+<p class="first admonition-title">Note</p>
+<p class="last">If invalid hexadecimal values are used with <span class="code">\x</span>, <span class="code">\u</span> +or <span class="code">\U</span> escapes, the end result is the original value without +the backslash character. For example, <span class="code">\xAX</span> (not hex) and +<span class="code">\U00110000</span> (too large value) result with <span class="code">xAX</span> +and <span class="code">U00110000</span>, respectively. This behavior may change in
+the future, though.</p>
+</div>
+<div class="note">
+<p class="first admonition-title">Note</p>
+<p class="last"><a class="reference internal" href="#built-in-variable">Built-in variable</a> <span class="var">${\n}</span> can be used if operating system +dependent line terminator is needed (<span class="code">\r\n</span> on Windows and
+<span class="code">\n</span> elsewhere).</p>
 </div>
 <div class="note">
 <p class="first admonition-title">Note</p>
@@ -2356,6 +2375,11 @@
 An exception to this rule is that the whitespace character is not
ignored inside the <a class="reference internal" href="#extended-variable-syntax">extended variable syntax</a>.</p>
 </div>
+<div class="note">
+<p class="first admonition-title">Note</p>
+<p class="last"><span class="code">\x</span>, <span class="code">\u</span> and <span class="code">\U</span> escape sequences are new in
+Robot Framework 2.8.2.</p>
+</div>
 </div>
 <div class="section" id="prevent-ignoring-empty-cells">
 <h5>Prevent ignoring empty cells</h5>
@@ -2367,8 +2391,8 @@
<a class="reference internal" href="#built-in-variable">built-in variable</a> <span class="var">${EMPTY}</span>. The latter is typically recommended as it is easier to understand. An exception to this recommendation is escaping the indented cells in <a class="reference internal" href="#for-loops">for loops</a> with a backslash when using the -<a class="reference internal" href="#space-separated-format">space separated format</a>. All this is illustrated in the following examples
-first in HTML and then in the space separated plain text format:</p>
+<a class="reference internal" href="#space-separated-format">space separated format</a>. All these cases are illustrated in the following +examples first in HTML and then in the space separated plain text format:</p>
 <table border="1" class="example docutils">
 <colgroup>
 <col width="22%" />
@@ -6091,7 +6115,7 @@
 </tr>
 <tr><td>${/}</td>
<td>The system directory path separator. <span class="code">/</span> in UNIX-like
-systems, <span class="code">\</span> in Windows.</td>
+systems and <span class="code">\</span> in Windows.</td>
 </tr>
 <tr><td>${:}</td>
<td>The system path element separator. <span class="code">:</span> in UNIX-like
@@ -6099,7 +6123,7 @@
 </tr>
 <tr><td>${\n}</td>
<td>The system line separator. <span class="code">\n</span> in UNIX-like systems and -systems and <span class="code">\r\n</span> in Windows. New in version 2.7.5.</td>
+<span class="code">\r\n</span> in Windows. New in version 2.7.5.</td>
 </tr>
 </tbody>
 </table>
@@ -17371,7 +17395,7 @@
 <div class="footer">
 <hr class="footer" />
<p>Generated by <a class="reference external" href="http://docutils.sourceforge.net/rst.html";>reStructuredText</a>. Syntax highlighting by <a class="reference external" href="http://pygments.org/";>Pygments</a>.</p>
-<p>Generated on: 2013-10-09 13:11 UTC.
+<p>Generated on: 2013-10-10 15:28 UTC.
 </p>

 </div>

==============================================================================
Revision: cb069817e2ef
Branch:   default
Author:   Robot Framework Developers (robotframew...@gmail.com)
Date:     Thu Oct 10 15:29:18 2013 UTC
Log:      Automated merge with https://robotframework.googlecode.com/hg/
http://code.google.com/p/robotframework/source/detail?r=cb069817e2ef


--

--- 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