[Git][reproducible-builds/diffoscope][master] Update R test fixture for R 4.2.x series.

Chris Lamb (@lamby) gitlab at salsa.debian.org
Fri Mar 25 11:40:19 UTC 2022



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
68638cd3 by Chris Lamb at 2022-03-25T11:39:12+00:00
Update R test fixture for R 4.2.x series.

- - - - -


2 changed files:

- tests/comparators/test_rdata.py
- tests/data/rdb_expected_diff


Changes:

=====================================
tests/comparators/test_rdata.py
=====================================
@@ -2,7 +2,7 @@
 # diffoscope: in-depth comparison of files, archives, and directories
 #
 # Copyright © 2017 Ximin Luo <infinity0 at debian.org>
-# Copyright © 2017, 2020-2021 Chris Lamb <lamby at debian.org>
+# Copyright © 2017, 2020-2022 Chris Lamb <lamby at debian.org>
 #
 # diffoscope is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -17,13 +17,15 @@
 # You should have received a copy of the GNU General Public License
 # along with diffoscope.  If not, see <https://www.gnu.org/licenses/>.
 
+import re
 import pytest
+import subprocess
 
 from diffoscope.comparators.gzip import GzipFile
 from diffoscope.comparators.rdata import RdbFile
 
 from ..utils.data import load_fixture, get_data, assert_diff
-from ..utils.tools import skip_unless_tools_exist
+from ..utils.tools import skip_unless_tools_exist, skip_unless_tool_is_at_least
 
 
 rdb1 = load_fixture("test1.rdb")
@@ -32,6 +34,18 @@ rdx1 = load_fixture("test1.rdx")
 rdx2 = load_fixture("test2.rdx")
 
 
+def rscript_version():
+    val = subprocess.check_output(
+        ("Rscript", "--version"), stderr=subprocess.STDOUT
+    )
+
+    m = re.search(r"version (?P<version>[^\(]+)\s", val.decode("utf-8"))
+    if not m:
+        return "~0unknown"
+
+    return m.group("version")
+
+
 def test_identification(rdb1, rdx1):
     assert isinstance(rdb1, RdbFile)
     assert isinstance(rdx1, GzipFile)
@@ -58,6 +72,7 @@ def test_num_items_rdb(differences_rdb):
 
 
 @skip_unless_tools_exist("Rscript")
+ at skip_unless_tool_is_at_least("Rscript", rscript_version, "4.2.0")
 def test_item_rdb(differences_rdb):
     assert differences_rdb[0].source1.startswith("Rscript")
     assert_diff(differences_rdb[0], "rdb_expected_diff")


=====================================
tests/data/rdb_expected_diff
=====================================
@@ -137,7 +137,7 @@
  
  .__NAMESPACE__. (environment) = 
  {
-     "S3methods" = "structure(character(0), .Dim = c(0L, 4L))"
+     "S3methods" = "structure(character(0), dim = c(0L, 4L))"
      "dynlibs" = "NULL"
      "exports" = "<environment>"
 -    "imports" = "list(base = TRUE, utils = c(aspell_package_Rd_files = "aspell_package_Rd_files", "



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/68638cd3916b8a81480b20855cc980f57592580c

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/68638cd3916b8a81480b20855cc980f57592580c
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20220325/a4dd9740/attachment.htm>


More information about the rb-commits mailing list