[Phylobase-commits] r943 - in pkg: inst/unitTests tests/testthat

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu May 8 00:11:45 CEST 2014


Author: francois
Date: 2014-05-08 00:11:44 +0200 (Thu, 08 May 2014)
New Revision: 943

Added:
   pkg/tests/testthat/test.phylobase.options.R
Removed:
   pkg/inst/unitTests/runit.phylobase.options.R
Log:
move/update phylobase.options tests

Deleted: pkg/inst/unitTests/runit.phylobase.options.R
===================================================================
--- pkg/inst/unitTests/runit.phylobase.options.R	2014-05-07 14:59:10 UTC (rev 942)
+++ pkg/inst/unitTests/runit.phylobase.options.R	2014-05-07 22:11:44 UTC (rev 943)
@@ -1,24 +0,0 @@
-
-###
-###  phylobase.options
-###
-
-op <- phylobase.options()
-test.phylobase.options <- function() {
-
-    ## test match.arg
-    checkException(phylobase.options(retic="test"))
-    no <- phylobase.options(retic="f")
-    checkIdentical(no$retic, "fail")
-    phylobase.options(op)
-
-    ## test multiple args
-    no <- phylobase.options(retic="f", poly="f")
-    checkIdentical(no$retic, "fail")
-    checkIdentical(no$poly, "fail")
-    phylobase.options(op)
-
-    ## check some failures
-    checkException(phylobase.options(1))
-    checkException(phylobase.options("foobar"="foo"))
-}

Copied: pkg/tests/testthat/test.phylobase.options.R (from rev 880, pkg/inst/unitTests/runit.phylobase.options.R)
===================================================================
--- pkg/tests/testthat/test.phylobase.options.R	                        (rev 0)
+++ pkg/tests/testthat/test.phylobase.options.R	2014-05-07 22:11:44 UTC (rev 943)
@@ -0,0 +1,32 @@
+
+###
+###  phylobase.options
+###
+
+context("phylobase.options()")
+
+test_that("test of match.arg", {
+    op <- phylobase.options()
+    ## test match.arg
+    expect_error(phylobase.options(retic="test"))
+    no <- phylobase.options(retic="f")
+    expect_equal(no$retic, "fail")
+    phylobase.options(op)
+})
+
+test_that("test of multiple arguments", {
+    op <- phylobase.options()
+    ## test multiple args
+    no <- phylobase.options(retic="f", poly="f")
+    expect_equal(no$retic, "fail")
+    expect_equal(no$poly, "fail")
+    phylobase.options(op)
+})
+
+test_that("test some failures", {
+    op <- phylobase.options()
+    ## check some failures
+    expect_error(phylobase.options(1))
+    expect_error(phylobase.options("foobar"="foo"))
+    phylobase.options(op)
+})



More information about the Phylobase-commits mailing list