added more tests to check for longer multiline string output and multiple multiline strings

This commit is contained in:
Kaylin Yeoh 2023-12-07 19:57:53 -05:00
parent f8f8e544b7
commit 21c08dae13
1 changed files with 56 additions and 3 deletions

View File

@ -397,17 +397,29 @@ class TestAssert_reprcompare:
]
def test_multiline_diff(self) -> None:
m = [
m1 = [
"This is some dummy test which shows the strange way in which Pycharm"
" displays the full diff."
]
assert callequal(m, []) == [
m2 = [
"This is some dummy test which shows the strange way in which Pycharm"
" displays the full diff.This is some dummy test which shows the strange way in which Pycharm"
" displays the full diff."
]
m3 = [
"This is some dummy test which shows the strange way in which Pycharm"
" displays the full diff.",
"This is some dummy test which shows the strange way in which Pycharm"
" displays the full diff."
]
assert callequal(m1, []) == [
"['This is som...e full diff.'] == []",
"Left contains one more item: 'This is some dummy test which shows the "
"strange way in which Pycharm displays the full diff.'",
'Use -v to get more diff',
]
assert callequal(m, [], verbose=True) == [
assert callequal(m1, [], verbose=True) == [
"['This is som...e full diff.'] == []",
"Left contains one more item: 'This is some dummy test which shows the "
"strange way in which Pycharm displays the full diff.'",
@ -416,6 +428,47 @@ class TestAssert_reprcompare:
"+ ['This is some dummy test which shows the strange way in which Pycharm "
"displays the full diff.']",
]
assert callequal(m2, []) == [
"['This is som...e full diff.'] == []",
"Left contains one more item: 'This is some dummy test which shows the "
"strange way in which Pycharm displays the full diff.This is some dummy test "
"which shows the strange way in which Pycharm displays the full diff.'",
'Use -v to get more diff',
]
assert callequal(m2, [], verbose=True) == [
"['This is som...e full diff.'] == []",
"Left contains one more item: 'This is some dummy test which shows the "
"strange way in which Pycharm displays the full diff.This is some dummy test "
"which shows the strange way in which Pycharm displays the full diff.'",
"Full diff:",
"- []",
"+ ['This is some dummy test which shows the strange way in which Pycharm "
"displays the full diff.This is some dummy test which shows the strange "
"way in which Pycharm displays the full diff.']",
]
assert callequal(m3, []) == [
"['This is som...e full diff.'] == []",
"Left contains 2 more items, first extra item: 'This is some dummy test which shows the strange way in "
"which Pycharm displays the full diff.'",
'Use -v to get more diff',
]
assert callequal(m3, [], verbose=True) == [
"['This is som...e full diff.'] == []",
"Left contains 2 more items, first extra item: 'This is some dummy test which shows the strange way in "
"which Pycharm displays the full diff.'",
"Full diff:",
" [",
"- ,",
"+ 'This is some dummy test which shows the strange way in which Pycharm "
"displays the full diff.',",
"+ 'This is some dummy test which shows the strange way in which Pycharm "
"displays the full diff.',",
" ]",
]
def test_text_skipping(self) -> None:
lines = callequal("a" * 50 + "spam", "a" * 50 + "eggs")