### Unit tests for functions in print.HLAMetric.R file
library(HLAClustRView)
data("demoHLADataset")
### Tests print() for HLAMetric class
context("print() HLAMetric class")
test_that("print() for HLAMetric object must return identical object", {
expeced <- calculateHamming(demoHLADataset)
result <- print(expeced)
expect_equal(result$dist, expeced$dist)
})
test_that("print() for HLAMetric object without distance must return identical object", {
demo <- calculateHamming(demoHLADataset)
demo[["dist"]] <- NULL
result <- print(demo)
expect_equal(result$dist, demo$dist)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.