diff options
author | Walter Dörwald <walter@livinglogic.de> | 2003-02-10 17:51:03 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2003-02-10 17:51:03 (GMT) |
commit | 4f046e2e2172d78245af2840f19fc562146b7c0e (patch) | |
tree | a83912700eebe590e814cd8d6e60faa39d47bef5 /Lib | |
parent | 74640247d40d192d9e672ebe5275a0bc510c6028 (diff) | |
download | cpython-4f046e2e2172d78245af2840f19fc562146b7c0e.zip cpython-4f046e2e2172d78245af2840f19fc562146b7c0e.tar.gz cpython-4f046e2e2172d78245af2840f19fc562146b7c0e.tar.bz2 |
Add a few tests to test_count() to increase coverage in
Object/unicodeobject.c::unicode_count().
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_unicode.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index 1b78ddd..85c3586 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -79,8 +79,14 @@ class UnicodeTest(unittest.TestCase): self.checkmethod('count', 'aaa', 0, u'b') 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', 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, 42) def test_title(self): self.checkmethod('title', u' hello ', u' Hello ') |