summaryrefslogtreecommitdiff
path: root/Lib/test/test_unicode.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2002-08-20 17:29:29 +0000
committerGuido van Rossum <guido@python.org>2002-08-20 17:29:29 +0000
commit76afbd9aa41bf34f488a7a1e759622c7f1830cff (patch)
treee4fb84ab073d0da8a668381b45dae2cb96c92c6a /Lib/test/test_unicode.py
parentc230b0e1f92bdc54318d58a07859bfcd7b03979a (diff)
downloadcpython-git-76afbd9aa41bf34f488a7a1e759622c7f1830cff.tar.gz
Fix some endcase bugs in unicode rfind()/rindex() and endswith().
These were reported and fixed by Inyeol Lee in SF bug 595350. The endswith() bug was already fixed in 2.3, but this adds some more test cases.
Diffstat (limited to 'Lib/test/test_unicode.py')
-rw-r--r--Lib/test/test_unicode.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index f5f4245ca2..4efa39cae1 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -107,6 +107,10 @@ test('find', u'abcdefghiabc', 9, u'abc', 1)
test('find', u'abcdefghiabc', -1, u'def', 4)
test('rfind', u'abcdefghiabc', 9, u'abc')
+test('rfind', 'abcdefghiabc', 9, u'abc')
+test('rfind', 'abcdefghiabc', 12, u'')
+test('rfind', u'abcdefghiabc', 12, '')
+test('rfind', u'abcdefghiabc', 12, u'')
test('lower', u'HeLLo', u'hello')
test('lower', u'hello', u'hello')
@@ -241,6 +245,8 @@ test('endswith', u'helloworld', False, u'lowo', 4, 7)
test('endswith', u'helloworld', False, u'lowo', 3, 8)
test('endswith', u'ab', False, u'ab', 0, 1)
test('endswith', u'ab', False, u'ab', 0, 0)
+test('endswith', 'helloworld', True, u'd')
+test('endswith', 'helloworld', False, u'l')
test('expandtabs', u'abc\rab\tdef\ng\thi', u'abc\rab def\ng hi')
test('expandtabs', u'abc\rab\tdef\ng\thi', u'abc\rab def\ng hi', 8)