Update to latest version.

This commit is contained in:
Elliott Sales de Andrade 2019-03-04 17:52:12 -05:00
parent 2b8bb043ed
commit 699b9b8bc2
4 changed files with 7 additions and 95 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
/purrr_0.3.0.tar.gz
/purrr_0.3.1.tar.gz

View File

@ -1,86 +0,0 @@
From 29f7778a53963c3f3d4a420ce36e1e060995bdb6 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Fri, 15 Feb 2019 06:30:58 -0500
Subject: [PATCH] Skip dplyr-related tests if unavailable.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
tests/testthat/test-flatten.R | 1 +
tests/testthat/test-imap.R | 1 +
tests/testthat/test-map.R | 1 +
tests/testthat/test-map_n.R | 5 +++++
tests/testthat/test-retired-invoke.R | 5 +++++
5 files changed, 13 insertions(+)
diff --git a/tests/testthat/test-flatten.R b/tests/testthat/test-flatten.R
index 0050bc1..62cb6ae 100644
--- a/tests/testthat/test-flatten.R
+++ b/tests/testthat/test-flatten.R
@@ -77,6 +77,7 @@ test_that("preserves inner names", {
# data frame flatten ------------------------------------------------------
test_that("can flatten to a data frame with named lists", {
+ skip_if_not_installed("dplyr")
expect_is(flatten_dfr(list(c(a = 1), c(b = 2))), "data.frame")
expect_equal(flatten_dfc(list(1)), tibble::tibble(V1 = 1))
})
diff --git a/tests/testthat/test-imap.R b/tests/testthat/test-imap.R
index 7574d16..59078a0 100644
--- a/tests/testthat/test-imap.R
+++ b/tests/testthat/test-imap.R
@@ -19,6 +19,7 @@ test_that("atomic vector imap works", {
})
test_that("data frame imap works", {
+ skip_if_not_installed("dplyr")
expect_identical(imap_dfc(x, paste), imap_dfr(x, paste))
})
diff --git a/tests/testthat/test-map.R b/tests/testthat/test-map.R
index a6a7253..5f960ae 100644
--- a/tests/testthat/test-map.R
+++ b/tests/testthat/test-map.R
@@ -61,6 +61,7 @@ test_that("map forces arguments in same way as base R", {
})
test_that("row and column binding work", {
+ skip_if_not_installed("dplyr")
mtcar_mod <- mtcars %>%
split(.$cyl) %>%
map(~ lm(mpg ~ wt, data = .x))
diff --git a/tests/testthat/test-map_n.R b/tests/testthat/test-map_n.R
index dba4f83..49594d5 100644
--- a/tests/testthat/test-map_n.R
+++ b/tests/testthat/test-map_n.R
@@ -47,6 +47,11 @@ test_that("outputs are suffixes have correct type", {
expect_is(pmap_dbl(list(x), mean), "numeric")
expect_is(pmap_chr(list(x), paste), "character")
expect_is(pmap_raw(list(x), as.raw), "raw")
+})
+
+test_that("outputs are suffixes have correct type for data frames", {
+ skip_if_not_installed("dplyr")
+ x <- 1:3
expect_is(pmap_dfr(list(x), as.data.frame), "data.frame")
expect_is(pmap_dfc(list(x), as.data.frame), "data.frame")
})
diff --git a/tests/testthat/test-retired-invoke.R b/tests/testthat/test-retired-invoke.R
index f35469e..5219651 100644
--- a/tests/testthat/test-retired-invoke.R
+++ b/tests/testthat/test-retired-invoke.R
@@ -33,7 +33,12 @@ test_that("invoke_map() works with bare function", {
expect_identical(invoke_map_lgl(`&&`, data), c(TRUE, TRUE))
expect_identical(invoke_map_raw(identity, as.raw(1:3)), as.raw(1:3))
+})
+
+test_that("invoke_map() works with bare function with data frames", {
+ skip_if_not_installed("dplyr")
+ data <- list(1:2, 3:4)
ops <- set_names(c(`+`, `-`), c("a", "b"))
expect_identical(invoke_map_dfr(ops, data), invoke_map_dfc(ops, data))
})
--
2.20.1

View File

@ -6,15 +6,13 @@
%global rlibdir %{_libdir}/R/library
Name: R-%{packname}
Version: 0.3.0
Version: 0.3.1
Release: 1%{?dist}
Summary: Functional Programming Tools
License: GPLv3
URL: https://CRAN.R-project.org/package=%{packname}
Source0: https://cran.r-project.org/src/contrib/%{packname}_%{version}.tar.gz
# https://github.com/tidyverse/purrr/pull/641
Patch0001: 0001-Skip-dplyr-related-tests-if-unavailable.patch
# Here's the R view of the dependencies world:
# Depends:
@ -50,12 +48,8 @@ A complete and consistent functional programming toolkit for R.
%prep
%setup -q -c -n %{packname}
pushd %{packname}
%patch0001 -p1
# Don't need coverage; it's not packaged either.
sed -i 's/covr, //g' DESCRIPTION
popd
sed -i 's/covr, //g' %{packname}/DESCRIPTION
%build
@ -93,5 +87,8 @@ _R_CHECK_FORCE_SUGGESTS_=0 %{_bindir}/R CMD check %{packname} --no-examples
%changelog
* Mon Mar 04 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.3.1-1
- Update to latest version
* Fri Feb 15 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.3.0-1
- initial package for Fedora

View File

@ -1 +1 @@
SHA512 (purrr_0.3.0.tar.gz) = dd220caee03515098927d26e0c7207e678715d0f14fe80a746ae2bd0a451a6f1a5b7245bd1bc3e094a899b710f2faf0a3853c72eafb2506d00dc4dc0e1d6d81b
SHA512 (purrr_0.3.1.tar.gz) = a72804cb96bd6fce8fb701cd0836ea624bcddea9a70598c4d4f0dfb29f157d351ae793d3e6bcc63c983d3597fbac6ce0b3fb41914c1c2b3d5f73cb6deb5f70e8