Skip to content
Snippets Groups Projects
Commit 68638cd3 authored by Chris Lamb's avatar Chris Lamb :eyes:
Browse files

Update R test fixture for R 4.2.x series.

parent f5a70b4b
No related branches found
No related tags found
No related merge requests found
Pipeline #361960 failed
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# diffoscope: in-depth comparison of files, archives, and directories # diffoscope: in-depth comparison of files, archives, and directories
# #
# Copyright © 2017 Ximin Luo <infinity0@debian.org> # Copyright © 2017 Ximin Luo <infinity0@debian.org>
# Copyright © 2017, 2020-2021 Chris Lamb <lamby@debian.org> # Copyright © 2017, 2020-2022 Chris Lamb <lamby@debian.org>
# #
# diffoscope is free software: you can redistribute it and/or modify # diffoscope is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
...@@ -17,13 +17,15 @@ ...@@ -17,13 +17,15 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with diffoscope. If not, see <https://www.gnu.org/licenses/>. # along with diffoscope. If not, see <https://www.gnu.org/licenses/>.
import re
import pytest import pytest
import subprocess
from diffoscope.comparators.gzip import GzipFile from diffoscope.comparators.gzip import GzipFile
from diffoscope.comparators.rdata import RdbFile from diffoscope.comparators.rdata import RdbFile
from ..utils.data import load_fixture, get_data, assert_diff 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") rdb1 = load_fixture("test1.rdb")
...@@ -32,6 +34,18 @@ rdx1 = load_fixture("test1.rdx") ...@@ -32,6 +34,18 @@ rdx1 = load_fixture("test1.rdx")
rdx2 = load_fixture("test2.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): def test_identification(rdb1, rdx1):
assert isinstance(rdb1, RdbFile) assert isinstance(rdb1, RdbFile)
assert isinstance(rdx1, GzipFile) assert isinstance(rdx1, GzipFile)
...@@ -58,6 +72,7 @@ def test_num_items_rdb(differences_rdb): ...@@ -58,6 +72,7 @@ def test_num_items_rdb(differences_rdb):
@skip_unless_tools_exist("Rscript") @skip_unless_tools_exist("Rscript")
@skip_unless_tool_is_at_least("Rscript", rscript_version, "4.2.0")
def test_item_rdb(differences_rdb): def test_item_rdb(differences_rdb):
assert differences_rdb[0].source1.startswith("Rscript") assert differences_rdb[0].source1.startswith("Rscript")
assert_diff(differences_rdb[0], "rdb_expected_diff") assert_diff(differences_rdb[0], "rdb_expected_diff")
......
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
.__NAMESPACE__. (environment) = .__NAMESPACE__. (environment) =
{ {
"S3methods" = "structure(character(0), .Dim = c(0L, 4L))" "S3methods" = "structure(character(0), dim = c(0L, 4L))"
"dynlibs" = "NULL" "dynlibs" = "NULL"
"exports" = "<environment>" "exports" = "<environment>"
- "imports" = "list(base = TRUE, utils = c(aspell_package_Rd_files = "aspell_package_Rd_files", " - "imports" = "list(base = TRUE, utils = c(aspell_package_Rd_files = "aspell_package_Rd_files", "
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment