Commit 4f046e2e authored by Walter Dörwald's avatar Walter Dörwald

Add a few tests to test_count() to increase coverage in

Object/unicodeobject.c::unicode_count().
parent 74640247
...@@ -79,8 +79,14 @@ class UnicodeTest(unittest.TestCase): ...@@ -79,8 +79,14 @@ class UnicodeTest(unittest.TestCase):
self.checkmethod('count', 'aaa', 0, u'b') self.checkmethod('count', 'aaa', 0, u'b')
self.checkmethod('count', u'aaa', 3, 'a') self.checkmethod('count', u'aaa', 3, 'a')
self.checkmethod('count', u'aaa', 0, 'b') self.checkmethod('count', u'aaa', 0, 'b')
self.checkmethod('count', u'aaa', 0, 'b')
self.checkmethod('count', u'aaa', 1, 'a', -1)
self.checkmethod('count', u'aaa', 3, 'a', -10)
self.checkmethod('count', u'aaa', 2, 'a', 0, -1)
self.checkmethod('count', u'aaa', 0, 'a', 0, -10)
self.assertRaises(TypeError, u'hello'.count) self.assertRaises(TypeError, u'hello'.count)
self.assertRaises(TypeError, u'hello'.count, 42)
def test_title(self): def test_title(self):
self.checkmethod('title', u' hello ', u' Hello ') self.checkmethod('title', u' hello ', u' Hello ')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment