[Phylobase-commits] r535 - pkg/inst/unitTests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Aug 20 20:10:49 CEST 2009


Author: regetz
Date: 2009-08-20 20:10:48 +0200 (Thu, 20 Aug 2009)
New Revision: 535

Modified:
   pkg/inst/unitTests/runit.methods-phylo4.R
Log:
restructured runit.methods-phylo4.R test to mirror the methods-phylo4.R
source file more directly. still need to write most of the tests.


Modified: pkg/inst/unitTests/runit.methods-phylo4.R
===================================================================
--- pkg/inst/unitTests/runit.methods-phylo4.R	2009-08-20 17:44:44 UTC (rev 534)
+++ pkg/inst/unitTests/runit.methods-phylo4.R	2009-08-20 18:10:48 UTC (rev 535)
@@ -15,9 +15,146 @@
 ## 3   spC    3       9        0.10       tip
 ## 4   spD    4       7        0.70       tip
 ## 5   spE    5       6        1.00       tip
+phyd <- as(phy, "phylo4d")
 
-test.edgeLength <- function() {
-    ans <- c(`8-1`=0.2)
-    checkEquals(edgeLength(phy, "spA"), ans)
+test.nTips.phylo4 <- function() {
+  checkEquals(5, nTips(phy))
+  checkEquals(5, nTips(phyd))
 }
 
+test.nTips.ANY <- function() {
+  # nTips phylo
+  checkEquals(5, nTips(tr))
+}
+
+test.nNodes.phylo4 <- function() {
+  checkEquals(4, nNodes(phy))
+  checkEquals(4, nNodes(phyd))
+}
+
+test.nodeType.phylo4 <- function() {
+}
+
+test.nodeId.phylo4 <- function() {
+  # do for type=c("internal","tip","allnode")
+}
+
+test.nEdges.phylo4 <- function() {
+}
+
+test.edges.phylo4 <- function() {
+  # function(x, order, drop.root=FALSE, ...)
+}
+
+test.edgeOrder.phylo4 <- function() {
+  # function(x, ...)
+}
+
+test.hasEdgeLength.phylo4 <- function() {
+  checkTrue(hasEdgeLength(phy))
+}
+
+test.edgeLength.phylo4 <- function() {
+  # all edge lengths
+  ans <- structure(c(0.2, 0.5, 0.2, 0.15, 0.1, 0.4, 0.1, 0.7, 1),
+    .Names = c("6-7", "7-8", "8-1", "8-9", "9-2", "NA-6", "9-3", "7-4",
+    "6-5"))
+  checkEquals(ans, edgeLength(phy))
+  # one edge length, by label
+  ans <- c(`8-1`=0.2)
+  checkEquals(ans, edgeLength(phy, "spA"))
+  # one edge length, by number
+  checkEquals(ans, edgeLength(phy, 1))
+  # non-existent edge, by label
+  ans <- structure(NA_real_, .Names = NA_character_)
+  checkEquals(ans, edgeLength(phy, "xxx"))
+  # non-existent edge, by number
+  checkEquals(ans, edgeLength(phy, 999))
+}
+
+test.Replace.edgeLength.phylo4 <- function() {
+  # function(x, use.names=TRUE, ..., value)
+}
+
+test.sumEdgeLength.phylo4 <- function() {
+  # function(phy, node)
+}
+
+test.isRooted.phylo4 <- function() {
+}
+
+test.rootNode.phylo4 <- function() {
+}
+
+test.Replace.rootNode.phylo4 <- function() {
+  # function(x, value)
+}
+
+test.labels.phylo4 <- function() {
+  # function(object, type = c("tip", "internal", "allnode"), ...)
+}
+
+test.Replace.labels.phylo4 <- function() {
+  # signature(object="phylo4", type="ANY", use.names="ANY", value="character"),
+  # function(object, type = c("tip", "internal", "allnode"), use.names, ..., value)
+}
+
+test.hasNodeLabels.phylo4 <- function() {
+}
+
+test.nodeLabels.phylo4 <- function() {
+}
+
+test.Replace.nodeLabels.phylo4 <- function() {
+  # signature(object="phylo4", value="character")
+  # function(object, ...,  value) {
+}
+
+test.tipLabels.phylo4 <- function() {
+}
+
+test.Replace.tipLabels.phylo4 <- function() {
+  # signature(object="phylo4", value="character")
+  # function(object, ...,  value) {
+}
+
+test.hasEdgeLabels.phylo4 <- function() {
+}
+
+test.edgeLabels.phylo4 <- function() {
+}
+
+test.Replace.edgeLabels.phylo4 <- function() {
+  # signature(object="phylo4", value="character")
+  # function(object, ...,  value) {
+}
+
+test.print.phylo4 <- function() {
+  # this just calls printphylo4 function
+}
+
+test.show.phylo4 <- function() {
+  # this just calls printphylo4 function
+}
+
+test.names.phylo4 <- function() {
+}
+
+test.head.phylo4 <- function() {
+}
+
+test.tail.phylo4 <- function() {
+}
+
+test.summary.phylo4 <- function() {
+ # function (object, quiet=FALSE)
+}
+
+test.orderIndex <- function() {
+  # function(phy, order = c('preorder', 'postorder'))
+}
+
+test.reorder.phylo4 <- function() {
+}
+
+



More information about the Phylobase-commits mailing list