From 1e9be586c8b59240cd3a4b583543972f89bdaa54 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Wed, 9 Apr 2003 06:50:59 +0000 Subject: StrCaseCmp tests: Add some tests in Katakana. Convert strings to UTF-8 before passing to test harness. (This used to be commit 79b292de98208571e49648cf88d9b565396151be) --- source3/stf/strings.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source3/stf') 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 -- cgit