| 1 |
# library(testthat) |
| 2 |
# library(dendextend) |
| 3 |
|
| 4 |
|
| 5 |
context("circlize") |
| 6 |
|
| 7 |
|
| 8 |
test_that("circlize_dendrogram works", { |
| 9 |
|
| 10 |
dend <- as.dendrogram(hclust(dist(mtcars))) |
| 11 |
|
| 12 |
# normal case |
| 13 |
expect_no_error( |
| 14 |
circlize_dendrogram(dend, labels_track_height = NA, labels = F) |
| 15 |
) |
| 16 |
|
| 17 |
# if duplicate labels |
| 18 |
labels(dend)[2] <- labels(dend)[1] |
| 19 |
expect_warning( |
| 20 |
circlize_dendrogram(dend) |
| 21 |
) |
| 22 |
# if circlize not installed |
| 23 |
expect_error(with_mocked_bindings( |
| 24 |
circlize_dendrogram(dend), |
| 25 |
requireNamespace = function(...) FALSE |
| 26 |
)) |
| 27 |
|
| 28 |
}) |