(self)
| 5 | |
| 6 | class DiffHelperSuite(Suite): |
| 7 | def test_render_diff_range(self) -> None: |
| 8 | expected = ["hello", "world"] |
| 9 | actual = ["goodbye", "world"] |
| 10 | |
| 11 | expected_ranges, actual_ranges = diff_ranges(expected, actual) |
| 12 | |
| 13 | output = io.StringIO() |
| 14 | render_diff_range(expected_ranges, expected, output=output) |
| 15 | assert output.getvalue() == " hello (diff)\n world\n" |
| 16 | output = io.StringIO() |
| 17 | render_diff_range(actual_ranges, actual, output=output) |
| 18 | assert output.getvalue() == " goodbye (diff)\n world\n" |
| 19 | |
| 20 | expected = ["a", "b", "c", "d", "e", "f", "g", "h", "circle", "i", "j"] |
| 21 | actual = ["a", "b", "c", "d", "e", "f", "g", "h", "square", "i", "j"] |
| 22 | |
| 23 | expected_ranges, actual_ranges = diff_ranges(expected, actual) |
| 24 | |
| 25 | output = io.StringIO() |
| 26 | render_diff_range(expected_ranges, expected, output=output, indent=0) |
| 27 | assert output.getvalue() == "a\nb\nc\n...\nf\ng\nh\ncircle (diff)\ni\nj\n" |
| 28 | output = io.StringIO() |
| 29 | render_diff_range(actual_ranges, actual, output=output, indent=0) |
| 30 | assert output.getvalue() == "a\nb\nc\n...\nf\ng\nh\nsquare (diff)\ni\nj\n" |
| 31 | |
| 32 | def test_diff_ranges(self) -> None: |
| 33 | a = ["hello", "world"] |
nothing calls this directly
no test coverage detected