Commit 1390b765 authored by Guangyuan Yang's avatar Guangyuan Yang Committed by Mattia Rizzolo

Fix 2 cases in test_device on FreeBSD

Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mattia@debian.org>
parent 2422e0f0
......@@ -17,6 +17,7 @@
# You should have received a copy of the GNU General Public License
# along with diffoscope. If not, see <https://www.gnu.org/licenses/>.
import os
import pytest
from diffoscope.comparators.binary import FilesystemFile
......@@ -46,10 +47,16 @@ def test_identification(devnull):
@skip_unless_tools_exist('xxd')
def test_diff(differences):
expected_diff = get_data('device_expected_diff')
if os.uname()[0] == 'FreeBSD':
expected_diff = get_data('device_expected_diff_freebsd')
else:
expected_diff = get_data('device_expected_diff')
assert normalize_zeros(differences.unified_diff) == expected_diff
@skip_unless_tools_exist('xxd')
def test_diff_reverse(differences_reverse):
expected_diff = get_data('device_expected_diff_reverse')
if os.uname()[0] == 'FreeBSD':
expected_diff = get_data('device_expected_diff_reverse_freebsd')
else:
expected_diff = get_data('device_expected_diff_reverse')
assert normalize_zeros(differences_reverse.unified_diff) == expected_diff
@@ -1,3 +1,28 @@
-00000000: 6465 7669 6365 3a63 6861 7261 6374 6572 device:character
-00000010: 0a6d 616a 6f72 3a20 300a 6d69 6e6f 723a .major: 0.minor:
-00000020: 2031 340a 14.
+00000000: 4c6f 7265 6d20 6970 7375 6d20 646f 6c6f Lorem ipsum dolo
+00000010: 7220 7369 7420 616d 6574 2c20 636f 6e73 r sit amet, cons
+00000020: 6563 7465 7475 7220 6164 6970 6973 6369 ectetur adipisci
+00000030: 6e67 2065 6c69 742c 2073 6564 2064 6f20 ng elit, sed do
+00000040: 6569 7573 6d6f 6420 7465 6d70 6f72 0a69 eiusmod tempor.i
+00000050: 6e63 6964 6964 756e 7420 7574 206c 6162 ncididunt ut lab
+00000060: 6f72 6520 6574 2064 6f6c 6f72 6520 6d61 ore et dolore ma
+00000070: 676e 6120 616c 6971 7561 2e20 5574 2065 gna aliqua. Ut e
+00000080: 6e69 6d20 6164 206d 696e 696d 2076 656e nim ad minim ven
+00000090: 6961 6d2c 2071 7569 730a 6e6f 7374 7275 iam, quis.nostru
+000000a0: 6420 6578 6572 6369 7461 7469 6f6e 2075 d exercitation u
+000000b0: 6c6c 616d 636f 206c 6162 6f72 6973 206e llamco laboris n
+000000c0: 6973 6920 7574 2061 6c69 7175 6970 2065 isi ut aliquip e
+000000d0: 7820 6561 2063 6f6d 6d6f 646f 2063 6f6e x ea commodo con
+000000e0: 7365 7175 6174 2e0a 4475 6973 2061 7574 sequat..Duis aut
+000000f0: 6520 6972 7572 6520 646f 6c6f 7220 696e e irure dolor in
+00000100: 2072 6570 7265 6865 6e64 6572 6974 2069 reprehenderit i
+00000110: 6e20 766f 6c75 7074 6174 6520 7665 6c69 n voluptate veli
+00000120: 7420 6573 7365 2063 696c 6c75 6d20 646f t esse cillum do
+00000130: 6c6f 7265 2065 750a 6675 6769 6174 206e lore eu.fugiat n
+00000140: 756c 6c61 2070 6172 6961 7475 722e 2045 ulla pariatur. E
+00000150: 7863 6570 7465 7572 2073 696e 7420 6f63 xcepteur sint oc
+00000160: 6361 6563 6174 2063 7570 6964 6174 6174 caecat cupidatat
+00000170: 206e 6f6e 2070 726f 6964 656e 742c 2073 non proident, s
+00000180: 756e 7420 696e 0a63 756c 7061 2071 7569 unt in.culpa qui
+00000190: 206f 6666 6963 6961 2064 6573 6572 756e officia deserun
+000001a0: 7420 6d6f 6c6c 6974 2061 6e69 6d20 6964 t mollit anim id
+000001b0: 2065 7374 206c 6162 6f72 756d 2e0a est laborum..
@@ -1,28 +1,3 @@
-00000000: 4c6f 7265 6d20 6970 7375 6d20 646f 6c6f Lorem ipsum dolo
-00000010: 7220 7369 7420 616d 6574 2c20 636f 6e73 r sit amet, cons
-00000020: 6563 7465 7475 7220 6164 6970 6973 6369 ectetur adipisci
-00000030: 6e67 2065 6c69 742c 2073 6564 2064 6f20 ng elit, sed do
-00000040: 6569 7573 6d6f 6420 7465 6d70 6f72 0a69 eiusmod tempor.i
-00000050: 6e63 6964 6964 756e 7420 7574 206c 6162 ncididunt ut lab
-00000060: 6f72 6520 6574 2064 6f6c 6f72 6520 6d61 ore et dolore ma
-00000070: 676e 6120 616c 6971 7561 2e20 5574 2065 gna aliqua. Ut e
-00000080: 6e69 6d20 6164 206d 696e 696d 2076 656e nim ad minim ven
-00000090: 6961 6d2c 2071 7569 730a 6e6f 7374 7275 iam, quis.nostru
-000000a0: 6420 6578 6572 6369 7461 7469 6f6e 2075 d exercitation u
-000000b0: 6c6c 616d 636f 206c 6162 6f72 6973 206e llamco laboris n
-000000c0: 6973 6920 7574 2061 6c69 7175 6970 2065 isi ut aliquip e
-000000d0: 7820 6561 2063 6f6d 6d6f 646f 2063 6f6e x ea commodo con
-000000e0: 7365 7175 6174 2e0a 4475 6973 2061 7574 sequat..Duis aut
-000000f0: 6520 6972 7572 6520 646f 6c6f 7220 696e e irure dolor in
-00000100: 2072 6570 7265 6865 6e64 6572 6974 2069 reprehenderit i
-00000110: 6e20 766f 6c75 7074 6174 6520 7665 6c69 n voluptate veli
-00000120: 7420 6573 7365 2063 696c 6c75 6d20 646f t esse cillum do
-00000130: 6c6f 7265 2065 750a 6675 6769 6174 206e lore eu.fugiat n
-00000140: 756c 6c61 2070 6172 6961 7475 722e 2045 ulla pariatur. E
-00000150: 7863 6570 7465 7572 2073 696e 7420 6f63 xcepteur sint oc
-00000160: 6361 6563 6174 2063 7570 6964 6174 6174 caecat cupidatat
-00000170: 206e 6f6e 2070 726f 6964 656e 742c 2073 non proident, s
-00000180: 756e 7420 696e 0a63 756c 7061 2071 7569 unt in.culpa qui
-00000190: 206f 6666 6963 6961 2064 6573 6572 756e officia deserun
-000001a0: 7420 6d6f 6c6c 6974 2061 6e69 6d20 6964 t mollit anim id
-000001b0: 2065 7374 206c 6162 6f72 756d 2e0a est laborum..
+00000000: 6465 7669 6365 3a63 6861 7261 6374 6572 device:character
+00000010: 0a6d 616a 6f72 3a20 300a 6d69 6e6f 723a .major: 0.minor:
+00000020: 2031 340a 14.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment