Skip to content

Commit

Permalink
Fix bug in test for r-devel
Browse files Browse the repository at this point in the history
  • Loading branch information
dgromer committed Mar 4, 2019
1 parent 0eb6d28 commit f5a05dc
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
^paper$
^CRAN-RELEASE$
^.*\.Rproj$
^\.Rproj\.user$
^cran-comments\.md$
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.RData
.Ruserdata
inst/doc
paper
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: apa
Type: Package
Title: Format Outputs of Statistical Tests According to APA Guidelines
Version: 0.3.1
Version: 0.3.2
Authors@R: person("Daniel", "Gromer", email = "[email protected]", role = c("aut", "cre"))
Description: Formatter functions in the 'apa' package take the return value of a
statistical test function, e.g. a call to chisq.test() and return a string
Expand All @@ -25,5 +25,5 @@ Suggests:
knitr
Encoding: UTF-8
LazyData: true
RoxygenNote: 6.1.0
RoxygenNote: 6.1.1
VignetteBuilder: knitr
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# apa 0.3.2

## Bug fixes

* Fix a test that returned a wrong result in r-devel (t-test now returns a list
with more elements).

# apa 0.3.1

## Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Test environments
* local Windows 10 Professional 64-bit install, R 3.5.1
* local Ubuntu 18.04 64-bit install, R 3.5.1
* devtools::check_win_devel()
* rhub::check_with_rdevel()

## R CMD check results
Expand Down
9 changes: 8 additions & 1 deletion tests/testthat/test-t-test.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
context("t_test")

test_that("t_test equals to t.test", {
expect_equal(t.test(1:10, y = c(7:20))[], t_test(1:10, y = c(7:20))[-10])

x <- t.test(1:10, y = c(7:20))[]

y <- t_test(1:10, y = c(7:20))
# Remove 'data' entry
y <- y[!(names(y) == "data")]

expect_equal(x, y)
})

test_that("t_test returns input data", {
Expand Down

0 comments on commit f5a05dc

Please sign in to comment.