nixpkgs/pkgs/tools/misc/diffoscope/fix-test_fit.patch
Andrew Marshall c7802e3062 diffoscope: Fix test failure
See https://github.com/NixOS/nixpkgs/issues/252045

Patch not yet upstreamed as a I do not have salsa.debian.org access.
2023-08-28 19:11:10 -04:00

59 lines
2.3 KiB
Diff

From f1e9fa32c925fe7fb3cd825a02dcff52d305d845 Mon Sep 17 00:00:00 2001
From: Andrew Marshall <andrew@johnandrewmarshall.com>
Date: Mon, 28 Aug 2023 19:03:38 -0400
Subject: [PATCH] Fix test_fit with file 5.45
See also 435a8fe9a201a7e74e705e06cc56b66fa6cb4af9.
---
tests/comparators/test_fit.py | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/tests/comparators/test_fit.py b/tests/comparators/test_fit.py
index d8478c00..47258a3e 100644
--- a/tests/comparators/test_fit.py
+++ b/tests/comparators/test_fit.py
@@ -27,7 +27,11 @@
from diffoscope.comparators.utils.specialize import specialize
from ..utils.data import data, assert_diff, load_fixture
-from ..utils.tools import skip_unless_tools_exist, skip_unless_tool_is_at_least
+from ..utils.tools import (
+ skip_unless_file_version_is_at_least,
+ skip_unless_tool_is_at_least,
+ skip_unless_tools_exist,
+)
from ..utils.nonexisting import assert_non_existing
cpio1 = load_fixture("test1.cpio")
@@ -124,19 +128,21 @@ def test_nested_listing(nested_differences):
@skip_unless_tools_exist("cpio")
@skip_unless_tool_is_at_least("dumpimage", dumpimage_version, "2021.01")
@skip_unless_tools_exist("fdtdump")
+@skip_unless_file_version_is_at_least("5.45")
def test_nested_symlink(nested_differences):
- assert nested_differences[1].source1 == "dir/link"
- assert nested_differences[1].comment == "symlink"
- assert_diff(nested_differences[1], "symlink_expected_diff")
+ assert nested_differences[2].source1 == "dir/link"
+ assert nested_differences[2].comment == "symlink"
+ assert_diff(nested_differences[2], "symlink_expected_diff")
@skip_unless_tools_exist("cpio")
@skip_unless_tool_is_at_least("dumpimage", dumpimage_version, "2021.01")
@skip_unless_tools_exist("fdtdump")
+@skip_unless_file_version_is_at_least("5.45")
def test_nested_compressed_files(nested_differences):
- assert nested_differences[2].source1 == "dir/text"
- assert nested_differences[2].source2 == "dir/text"
- assert_diff(nested_differences[2], "text_ascii_expected_diff")
+ assert nested_differences[3].source1 == "dir/text"
+ assert nested_differences[3].source2 == "dir/text"
+ assert_diff(nested_differences[3], "text_ascii_expected_diff")
@skip_unless_tools_exist("cpio")
--
2.41.0