merge with remote
[epclust.git] / pkg / tests / testthat / test-computeWerDists.R
diff --git a/pkg/tests/testthat/test-computeWerDists.R b/pkg/tests/testthat/test-computeWerDists.R
new file mode 100644 (file)
index 0000000..09ad5c8
--- /dev/null
@@ -0,0 +1,18 @@
+context("computeWerDists")
+
+test_that("computeWerDists output correct results",
+{
+       nbytes <- 8
+       endian <- "little"
+
+       # On two identical series
+       serie <- rnorm(212, sd=5)
+       series <- cbind(serie, serie)
+       getSeries <- function(indices) as.matrix(series[,indices])
+       dists <- computeWerDists(1:2, getSeries, 50, 3, 4, nbytes, endian,
+               verbose=TRUE)
+       expect_equal(dists, matrix(0.,nrow=2,ncol=2))
+
+       # On two constant series
+       # TODO: ref results. Ask Jairo to check function.
+})