diff-edit/tests/diff_editor_test.py
Andrew Hamilton 80048c64f8 Optimize editing large files
- Fixed slow editing on large files.
  - Only calculating appearance of lines that are seen.
  - Not resizing all lines when max line length changes.
- Fast changing of syntax highlighting themes.
- Faster startup, since not highlighting all lines.
2022-03-11 19:20:51 +10:00

19 lines
542 B
Python
Executable file

#!/usr/bin/env python3
import unittest
import diff_edit
class OverlayListTestCase(unittest.TestCase):
def test_overlay_list(self):
self.assertEqual(diff_edit.overlay_list([1, 2, 3, 4], [5, 6], 0), [5, 6, 3, 4])
self.assertEqual(diff_edit.overlay_list([1, 2, 3, 4], [5, 6], 3), [1, 2, 3, 5])
self.assertEqual(diff_edit.overlay_list([1, 2, 3, 4], [5, 6], -1), [6, 2, 3, 4])
self.assertEqual(diff_edit.overlay_list([5, 6], [1, 2, 3, 4], -1), [2, 3])
if __name__ == "__main__":
unittest.main()