tests/testthat/test-is.functions.R
raw| 1 | # library(testthat) |
| 2 | # library(dendextend) |
| 3 | |
| 4 | |
| 5 | context("is.functions") |
| 6 | |
| 7 | |
| 8 | test_that("is.phylo works", { |
| 9 | dend <- as.dendrogram(hclust(dist(1:5))) |
| 10 | phy <- ape::as.phylo(dend) |
| 11 | |
| 12 | expect_true( |
| 13 | is.phylo(phy) |
| 14 | ) |
| 15 | }) |
| 16 | |
| 17 | |
| 18 | test_that("fac2num works", { |
| 19 | # if non-factor object passed in |
| 20 | expect_error( |
| 21 | fac2num(1:4) |
| 22 | ) |
| 23 | }) |