We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8e97d08 commit 5ec7140Copy full SHA for 5ec7140
1 file changed
Lib/test/test_difflib.py
@@ -29,26 +29,13 @@ def test_one_delete(self):
29
('delete', 40, 41, 40, 40),
30
('equal', 41, 81, 40, 80)])
31
32
-
33
def test_opcode_caching(self):
34
sm = difflib.SequenceMatcher(None, 'b' * 100, 'a' + 'b' * 100)
35
- self.assertEqual(list(sm.get_opcodes()),
36
- [ ('insert', 0, 0, 0, 1),
37
- ('equal', 0, 100, 1, 101)])
38
39
- sm.a = 'a' * 40 + 'c' + 'b' * 40
40
- sm.b = 'a' * 40 + 'b' * 40
41
+ opcode = sm.get_opcodes()
+ self.assertEqual(opcode,
42
[ ('insert', 0, 0, 0, 1),
43
('equal', 0, 100, 1, 101)])
44
45
- # To avoid caching in set_seqs.
46
- sm.set_seqs("".join(list(sm.a)), "".join(list(sm.b)))
47
48
- [ ('equal', 0, 40, 0, 40),
49
- ('delete', 40, 41, 40, 40),
50
- ('equal', 41, 81, 40, 80)])
51
+ self.assertIs(opcode, sm.get_opcodes())
52
53
def test_bjunk(self):
54
sm = difflib.SequenceMatcher(isjunk=lambda x: x == ' ',
0 commit comments