[Dplr-commits] r947 - pkg/dplR/tests/testthat
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Jan 21 13:50:29 CET 2015
Author: mvkorpel
Date: 2015-01-21 13:50:29 +0100 (Wed, 21 Jan 2015)
New Revision: 947
Modified:
pkg/dplR/tests/testthat/test-dplR.R
pkg/dplR/tests/testthat/test-io.R
Log:
Added some expected error message fragments
Modified: pkg/dplR/tests/testthat/test-dplR.R
===================================================================
--- pkg/dplR/tests/testthat/test-dplR.R 2015-01-21 09:35:45 UTC (rev 946)
+++ pkg/dplR/tests/testthat/test-dplR.R 2015-01-21 12:50:29 UTC (rev 947)
@@ -126,8 +126,8 @@
res.8 <- combine.rwl(df.1, df.4)
## Test
test_that("combine.rwl stops with nothing to combine", {
- expect_error(combine.rwl(list()))
- expect_error(combine.rwl(df.1))
+ expect_error(combine.rwl(list()),"nothing to combine",ignore.case=TRUE)
+ expect_error(combine.rwl(df.1), "nothing to combine", ignore.case=TRUE)
})
test_that("combine.rwl works with a list of length one", {
expect_equal(res.3, df.1)
@@ -483,9 +483,9 @@
expect_more_than(error.2, error.3)
})
test_that("ffcsaps stops on bad parameters", {
- expect_error(ffcsaps(y, f=-1))
- expect_error(ffcsaps(y, f=2))
- expect_error(ffcsaps(y, nyrs=0))
+ expect_error(ffcsaps(y, f=-1), "between 0 and 1")
+ expect_error(ffcsaps(y, f=2), "between 0 and 1")
+ expect_error(ffcsaps(y, nyrs=0), "greater than 1")
})
}
test.ffcsaps()
Modified: pkg/dplR/tests/testthat/test-io.R
===================================================================
--- pkg/dplR/tests/testthat/test-io.R 2015-01-21 09:35:45 UTC (rev 946)
+++ pkg/dplR/tests/testthat/test-io.R 2015-01-21 12:50:29 UTC (rev 947)
@@ -10,7 +10,7 @@
fh)
close(fh)
test_that("read.tucson catches lines that are too long", {
- expect_error(read.tucson(tf))
+ expect_error(read.tucson(tf), "failed to read")
})
## Precision 0.01
@@ -107,7 +107,7 @@
"TEST8A 1730 1230 456 789 12 34 999"), fh8)
close(fh8)
test_that("read.tucson stops on overlapping data", {
- expect_error(read.tucson(tf8))
+ expect_error(read.tucson(tf8), "failed to read")
})
## Non-standard file with missing decade
More information about the Dplr-commits
mailing list