diff options
author | Martin Pool <mbp@samba.org> | 2003-04-09 06:50:59 +0000 |
---|---|---|
committer | Martin Pool <mbp@samba.org> | 2003-04-09 06:50:59 +0000 |
commit | 1e9be586c8b59240cd3a4b583543972f89bdaa54 (patch) | |
tree | 5f637028bc30127e67ce0af82bb5bb459acda8f0 /source3/stf/strings.py | |
parent | 7f11621e1ab0807a824d6013105e351baa8ef308 (diff) | |
download | samba-1e9be586c8b59240cd3a4b583543972f89bdaa54.tar.gz samba-1e9be586c8b59240cd3a4b583543972f89bdaa54.tar.bz2 samba-1e9be586c8b59240cd3a4b583543972f89bdaa54.zip |
StrCaseCmp tests: Add some tests in Katakana. Convert strings to
UTF-8 before passing to test harness.
(This used to be commit 79b292de98208571e49648cf88d9b565396151be)
Diffstat (limited to 'source3/stf/strings.py')
-rwxr-xr-x | source3/stf/strings.py | 8 |
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 |