summaryrefslogtreecommitdiff
path: root/source3/stf/strings.py
diff options
context:
space:
mode:
Diffstat (limited to 'source3/stf/strings.py')
-rwxr-xr-xsource3/stf/strings.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/source3/stf/strings.py b/source3/stf/strings.py
index 4e070c0444..328849b1ce 100755
--- a/source3/stf/strings.py
+++ b/source3/stf/strings.py
@@ -62,10 +62,10 @@ class PushUCS2_Tests(comfychair.TestCase):
self.assert_equal(out, "0\n")
-class StrCaseCmp_Ascii_Tests(comfychair.TestCase):
+class StrCaseCmp(comfychair.TestCase):
"""String comparisons in simple ASCII"""
def run_strcmp(self, a, b, expect):
- out, err = self.runcmd('t_strcmp \"%s\" \"%s\"' % (a, b))
+ out, err = self.runcmd('t_strcmp \"%s\" \"%s\"' % (a.encode('utf-8'), b.encode('utf-8')))
if signum(int(out)) != expect:
self.fail("comparison failed:\n"
" a=%s\n"
@@ -88,12 +88,14 @@ class StrCaseCmp_Ascii_Tests(comfychair.TestCase):
('longstring ' * 100, 'longstring ' * 100, 0),
('longstring ' * 100, 'longstring ' * 100 + 'a', -1),
('longstring ' * 100 + 'a', 'longstring ' * 100, +1),
+ (KATAKANA_LETTER_A, KATAKANA_LETTER_A, 0),
+ (KATAKANA_LETTER_A, 'a', 1),
]
for a, b, expect in cases:
self.run_strcmp(a, b, expect)
# Define the tests exported by this module
-tests = [StrCaseCmp_Ascii_Tests,
+tests = [StrCaseCmp,
PushUCS2_Tests]
# Handle execution of this file as a main program