Barry Warsaw | 04f357c | 2002-07-23 19:04:11 +0000 | [diff] [blame] | 1 | import difflib |
| 2 | from test import test_support |
Neal Norwitz | e7dfe21 | 2003-07-01 14:59:46 +0000 | [diff] [blame] | 3 | import unittest |
Raymond Hettinger | 43d790c | 2003-07-16 04:34:56 +0000 | [diff] [blame] | 4 | import doctest |
Neal Norwitz | e7dfe21 | 2003-07-01 14:59:46 +0000 | [diff] [blame] | 5 | |
| 6 | class TestSFbugs(unittest.TestCase): |
| 7 | |
| 8 | def test_ratio_for_null_seqn(self): |
| 9 | # Check clearing of SF bug 763023 |
| 10 | s = difflib.SequenceMatcher(None, [], []) |
| 11 | self.assertEqual(s.ratio(), 1) |
| 12 | self.assertEqual(s.quick_ratio(), 1) |
| 13 | self.assertEqual(s.real_quick_ratio(), 1) |
| 14 | |
Raymond Hettinger | 43d790c | 2003-07-16 04:34:56 +0000 | [diff] [blame] | 15 | Doctests = doctest.DocTestSuite(difflib) |
| 16 | |
| 17 | test_support.run_unittest(TestSFbugs, Doctests) |