Beispiel #1
0
 def test_consume_change(self):
     detector = _TextChangeDetector('1\n2\n', '1\n3\n')
     self.assertTrue(detector.is_changed(1, 2))
     self.assertTrue(detector.consume_changes(1, 2))
     self.assertFalse(detector.is_changed(1, 2))
Beispiel #2
0
 def test_line_removals(self):
     detector = _TextChangeDetector('1\n3\n4\n2\n', '1\n2\n')
     self.assertFalse(detector.is_changed(1, 1))
     self.assertTrue(detector.is_changed(2, 3))
     self.assertFalse(detector.is_changed(4, 4))
Beispiel #3
0
 def test_multi_line_checks(self):
     detector = _TextChangeDetector('1\n2\n', '1\n3\n')
     self.assertTrue(detector.is_changed(1, 2))
Beispiel #4
0
 def test_one_line_change(self):
     detector = _TextChangeDetector('1\n2\n', '1\n3\n')
     self.assertFalse(detector.is_changed(1, 1))
     self.assertTrue(detector.is_changed(2, 2))
Beispiel #5
0
 def test_line_expansion(self):
     detector = _TextChangeDetector('1\n2\n', '1\n3\n4\n2\n')
     self.assertFalse(detector.is_changed(1, 1))
     self.assertFalse(detector.is_changed(2, 2))
Beispiel #6
0
 def test_consume_change(self):
     detector = _TextChangeDetector('1\n2\n', '1\n3\n')
     self.assertTrue(detector.is_changed(1, 2))
     self.assertTrue(detector.consume_changes(1, 2))
     self.assertFalse(detector.is_changed(1, 2))
Beispiel #7
0
 def test_trivial_case(self):
     detector = _TextChangeDetector('\n', '\n')
     self.assertFalse(detector.is_changed(1, 1))
Beispiel #8
0
 def test_multi_line_checks(self):
     detector = _TextChangeDetector('1\n2\n', '1\n3\n')
     self.assertTrue(detector.is_changed(1, 2))
Beispiel #9
0
 def test_line_removals(self):
     detector = _TextChangeDetector('1\n3\n4\n2\n', '1\n2\n')
     self.assertFalse(detector.is_changed(1, 1))
     self.assertTrue(detector.is_changed(2, 3))
     self.assertFalse(detector.is_changed(4, 4))
Beispiel #10
0
 def test_line_expansion(self):
     detector = _TextChangeDetector('1\n2\n', '1\n3\n4\n2\n')
     self.assertFalse(detector.is_changed(1, 1))
     self.assertFalse(detector.is_changed(2, 2))
Beispiel #11
0
 def test_one_line_change(self):
     detector = _TextChangeDetector('1\n2\n', '1\n3\n')
     self.assertFalse(detector.is_changed(1, 1))
     self.assertTrue(detector.is_changed(2, 2))
Beispiel #12
0
 def test_trivial_case(self):
     detector = _TextChangeDetector('\n', '\n')
     self.assertFalse(detector.is_changed(1, 1))