summaryrefslogtreecommitdiff
path: root/source/stf
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2003-03-19 08:32:42 +0000
committerMartin Pool <mbp@samba.org>2003-03-19 08:32:42 +0000
commitac6027884b04943fac3d469ff6542d62293f46cc (patch)
tree24001b4f26360df74a1f905f0cc73e38e1aae413 /source/stf
parenta5a2cc9ae9668e66d39beed1fdad4df0405fa4da (diff)
downloadsamba-ac6027884b04943fac3d469ff6542d62293f46cc.tar.gz
Add additional StrCaseCmp test cases.
Doc.
Diffstat (limited to 'source/stf')
-rwxr-xr-xsource/stf/strings.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/source/stf/strings.py b/source/stf/strings.py
index fb26c2f9e56..a67e1370588 100755
--- a/source/stf/strings.py
+++ b/source/stf/strings.py
@@ -42,16 +42,28 @@ class StrCaseCmp_Ascii_Tests(comfychair.TestCase):
" result=%s\n" % (`a`, `b`, `expect`, `out`))
def runtest(self):
+ # A, B, strcasecmp(A, B)
cases = [('hello', 'hello', 0),
('hello', 'goodbye', +1),
('goodbye', 'hello', -1),
- ('hell', 'hello', -1)]
+ ('hell', 'hello', -1),
+ ('', '', 0),
+ ('a', '', +1),
+ ('', 'a', -1),
+ ('a', 'A', 0),
+ ('aa', 'aA', 0),
+ ('Aa', 'aa', 0),
+ ('longstring ' * 100, 'longstring ' * 100, 0),
+ ('longstring ' * 100, 'longstring ' * 100 + 'a', -1),
+ ('longstring ' * 100 + 'a', 'longstring ' * 100, +1),
+ ]
for a, b, expect in cases:
self.run_strcmp(a, b, expect)
-
+# Define the tests exported by this module
tests = [StrCaseCmp_Ascii_Tests]
+# Handle execution of this file as a main program
if __name__ == '__main__':
comfychair.main(tests)