Add a patch to fix big-endian test results.

This commit is contained in:
Elliott Sales de Andrade 2020-12-31 03:06:51 -05:00
parent e622090dd5
commit 3bd0232bb9
3 changed files with 36 additions and 1 deletions

View File

@ -1,7 +1,7 @@
From 1890689ab03ed9cfdc193501c0fc48cb0bab339b Mon Sep 17 00:00:00 2001 From 1890689ab03ed9cfdc193501c0fc48cb0bab339b Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com> From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Wed, 30 Dec 2020 20:07:56 -0500 Date: Wed, 30 Dec 2020 20:07:56 -0500
Subject: [PATCH] Unbundle libxxhash. Subject: [PATCH 1/2] Unbundle libxxhash.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com> Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
--- ---

View File

@ -0,0 +1,32 @@
From 5feac2b6b427905cdb73dc947973aabfdb825f0d Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Thu, 31 Dec 2020 02:45:14 -0500
Subject: [PATCH 2/2] Add test hashes for big-endian machines.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
tests/testthat/test-hash.R | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/tests/testthat/test-hash.R b/tests/testthat/test-hash.R
index c43c82ba..fb74d14c 100644
--- a/tests/testthat/test-hash.R
+++ b/tests/testthat/test-hash.R
@@ -1,5 +1,11 @@
test_that("simple hashes with no ALTREP and no attributes are reproducible", {
- expect_identical(hash(1), "a3f7d4a39b65b170005aafbbeed05106")
- expect_identical(hash("a"), "4d52a7da68952b85f039e85a90f9bbd2")
- expect_identical(hash(1:5 + 0L), "0d26bf75943b8e13c080c6bab12a7440")
+ if (.Platform$endian == "little") {
+ expect_identical(hash(1), "a3f7d4a39b65b170005aafbbeed05106")
+ expect_identical(hash("a"), "4d52a7da68952b85f039e85a90f9bbd2")
+ expect_identical(hash(1:5 + 0L), "0d26bf75943b8e13c080c6bab12a7440")
+ } else {
+ expect_identical(hash(1), "e102171758b6df27bab06e4b99ad7d61")
+ expect_identical(hash("a"), "49a20bac2e944a3b87d0f5f70b8b5553")
+ expect_identical(hash(1:5 + 0L), "f24b071216a7d95ccbfcf28616107d64")
+ }
})
--
2.29.2

View File

@ -14,6 +14,8 @@ License: MIT
URL: https://CRAN.R-project.org/package=%{packname} URL: https://CRAN.R-project.org/package=%{packname}
Source0: https://cran.r-project.org/src/contrib/%{packname}_%{packver}.tar.gz Source0: https://cran.r-project.org/src/contrib/%{packname}_%{packver}.tar.gz
Patch0001: 0001-Unbundle-libxxhash.patch Patch0001: 0001-Unbundle-libxxhash.patch
# https://github.com/r-lib/rlang/pull/1084
Patch0002: 0002-Add-test-hashes-for-big-endian-machines.patch
# Here's the R view of the dependencies world: # Here's the R view of the dependencies world:
# Depends: # Depends:
@ -50,6 +52,7 @@ system, and core 'Tidyverse' features like tidy evaluation.
pushd %{packname} pushd %{packname}
%patch0001 -p1 %patch0001 -p1
%patch0002 -p1
# Don't need coverage; it's not packaged either. # Don't need coverage; it's not packaged either.
sed -i 's/covr, //g' DESCRIPTION sed -i 's/covr, //g' DESCRIPTION