Revision: 477a00d80f3e
Branch:   default
Author:   Pekka Klärck
Date:     Wed Sep 12 05:53:30 2012
Log: Fixed extended variable syntax when variable name contains non-ASCII chars.

Update issue 1124
Status: Done
Fixed with a test. Also fixed one unrelated test that failed after this change.
http://code.google.com/p/robotframework/source/detail?r=477a00d80f3e

Modified:
 /atest/robot/core/invalid_syntax.txt
 /atest/robot/variables/extended_variables.txt
 /atest/testdata/variables/extended_variables.txt
 /src/robot/variables/variables.py

=======================================
--- /atest/robot/core/invalid_syntax.txt        Mon Oct 31 23:00:37 2011
+++ /atest/robot/core/invalid_syntax.txt        Wed Sep 12 05:53:30 2012
@@ -14,7 +14,7 @@
     Verify Error  Library setting requires a name  Setting
Verify Error Importing test library 'NonExistingLibrary' failed: ImportError: Setting
     Check Test Case  Check Valid Library Import
- Verify Error Replacing variables from setting 'Library' failed: Resolving variable '\${unicode���}' failed: Non-existing variable '\${unicode}'. Setting + Verify Error Replacing variables from setting 'Library' failed: Resolving variable '\${unicode���}' failed: Non-existing variable '\${unicodeï}'. Setting

 Resource Imports
Verify Error Resource file 'non-existing-resource.html' does not exist Setting
=======================================
--- /atest/robot/variables/extended_variables.txt       Tue Oct 26 06:24:51 2010
+++ /atest/robot/variables/extended_variables.txt       Wed Sep 12 05:53:30 2012
@@ -45,6 +45,9 @@

 Testing Extended Var Regexp
     Check Test Case  ${TESTNAME}
+
+Base name contains non-ASCII characters
+    Check Test Case  ${TESTNAME}

 Failing When Attribute Does Not exists
     Check Test Case  ${TESTNAME} 1
=======================================
--- /atest/testdata/variables/extended_variables.txt Tue Oct 26 07:13:17 2010 +++ /atest/testdata/variables/extended_variables.txt Wed Sep 12 05:53:30 2012
@@ -84,6 +84,12 @@
     Should Be Equal  ${var.}  ${var.capitalize()}
     Should Be Equal  ${var.upper}  ${_ V _ A _ R _ . upper ( ) }
Log Many So this works ${var.upper()} but this does not ${var..upper()}
+
+Base name contains non-ASCII characters
+    ${äiti}=  Set Variable    hyvä
+    Should Be Equal    ${äiti.upper()}    HYVÄ
+    ${isä}=  Set Variable    hyvä
+    Should Be Equal    ${isä.upper()}    HYVÄ

 Failing When Attribute Does Not exists 1
[Documentation] FAIL STARTS: Resolving variable '\${OBJ.nonex}' failed: AttributeError:
=======================================
--- /src/robot/variables/variables.py   Wed Aug 29 05:50:26 2012
+++ /src/robot/variables/variables.py   Wed Sep 12 05:53:30 2012
@@ -44,7 +44,7 @@
     (.+?)        # base name (group 1)
     ([^\s\w].+)  # extended part (group 2)
     }$           # "}" and end of the string
-    ''', re.VERBOSE)
+    ''', re.UNICODE|re.VERBOSE)

     def __init__(self, identifiers=('$','@','%','&','*')):
         utils.NormalizedDict.__init__(self, ignore=['_'])

Reply via email to