MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_default_args

Method test_default_args

Lib/test/test_difflib.py:566–592  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

564 [b[i:i + n + 1] for i in range(0, len(b) - n - 1)])
565
566 def test_default_args(self):
567 a = 'foo bar'
568 b = 'foo baz bar'
569 sm = difflib.SequenceMatcher(a=a, b=b)
570 match = sm.find_longest_match()
571 self.assertEqual(match.a, 0)
572 self.assertEqual(match.b, 0)
573 self.assertEqual(match.size, 6)
574 self.assertEqual(a[match.a: match.a + match.size],
575 b[match.b: match.b + match.size])
576 self.assertFalse(self.longer_match_exists(a, b, match.size))
577
578 match = sm.find_longest_match(alo=2, blo=4)
579 self.assertEqual(match.a, 3)
580 self.assertEqual(match.b, 7)
581 self.assertEqual(match.size, 4)
582 self.assertEqual(a[match.a: match.a + match.size],
583 b[match.b: match.b + match.size])
584 self.assertFalse(self.longer_match_exists(a[2:], b[4:], match.size))
585
586 match = sm.find_longest_match(bhi=5, blo=1)
587 self.assertEqual(match.a, 1)
588 self.assertEqual(match.b, 1)
589 self.assertEqual(match.size, 4)
590 self.assertEqual(a[match.a: match.a + match.size],
591 b[match.b: match.b + match.size])
592 self.assertFalse(self.longer_match_exists(a, b[1:5], match.size))
593
594 def test_longest_match_with_popular_chars(self):
595 a = 'dabcd'

Callers

nothing calls this directly

Calls 4

find_longest_matchMethod · 0.95
longer_match_existsMethod · 0.95
assertFalseMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected