Skip to content
GitLab
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
Reproducible Builds
diffoscope
Compare revisions
5269c1c0ed8ed29eeb609ac979a6aabeb1743916...c2be319586dccc4a8945323f1f442b2ecb49d844
Commits (2)
Add an allowed-to-fail test regarding a regression in directory handling.
· ceb90b5d
Chris Lamb
authored
Feb 01, 2022
ceb90b5d
Tidy control flow in Difference._reverse_self a little.
· c2be3195
Chris Lamb
authored
Feb 04, 2022
c2be3195
Hide whitespace changes
Inline
Side-by-side
diffoscope/difference.py
View file @
c2be3195
...
...
@@ -116,11 +116,11 @@ class Difference:
raise
NotImplementedError
(
"_reverse_self on VisualDifference is not yet implemented"
)
unified_diff
=
(
reverse_unified_diff
(
self
.
unified_diff
)
if
self
.
unified_diff
is
not
None
else
None
)
unified_diff
=
None
if
self
.
unified_diff
is
not
None
:
unified_diff
=
reverse_unified_diff
(
self
.
unified_diff
)
return
self
.
__class__
(
self
.
source2
,
self
.
source1
,
...
...
tests/comparators/test_directory.py
View file @
c2be3195
...
...
@@ -111,3 +111,16 @@ def test_compare_to_dangling_symlink(tmpdir):
b
=
specialize
(
FilesystemFile
(
path
))
assert
a
.
compare
(
b
).
unified_diff
==
get_data
(
"test_directory_symlink_diff"
)
@pytest.mark.xfail
(
strict
=
False
)
def
test_compare_both_ways
(
tmpdir
):
"""
Comparing a directory with a file shouldn't crash, but nor should as
comparing a file with a directory either. (Re: #292)
"""
a
=
specialize
(
FilesystemFile
(
str
(
tmpdir
)))
b
=
specialize
(
FilesystemFile
(
TEST_FILE1_PATH
))
a
.
compare
(
b
)
b
.
compare
(
a
)