From 906eef3f727d2dd2c0715a477c414827106070f1 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Camps Date: Wed, 10 Apr 2019 17:18:34 +0200 Subject: [PATCH] drafting new tests for future version --- tests/testthat/test-PCC.Exploratory.R | 22 ++++++++++++++++++++++ tests/testthat/test-PCC.R | 24 ++++++++++++------------ 2 files changed, 34 insertions(+), 12 deletions(-) diff --git a/tests/testthat/test-PCC.Exploratory.R b/tests/testthat/test-PCC.Exploratory.R index ca0658b..333aeca 100644 --- a/tests/testthat/test-PCC.Exploratory.R +++ b/tests/testthat/test-PCC.Exploratory.R @@ -158,3 +158,25 @@ test_that("yields expected output on smaller case", { #VL12 1 2 2 2 1 1 2 2 #TODO: extend it to other exploratory functions ! +# +# test_that("works on non numeric input", { +# x = matrix(data = c( +# "1","1","2","2","1,2", +# "1","1","2","2","1,2", +# "0","0","1","2","1,2", +# "1","1","2","2","1", +# "1","1","2","2","2", +# "1","2","3","4","5" +# ), byrow = TRUE, +# ncol = 5, +# nrow = 6, +# dimnames = list( +# c("VL1", "VL2", "VL3", "VL4", "VL5", "VL6"), +# c("A","B","C","D","E") +# ) +# ) +# # TODO: create test and debug for very small databases +# PCC.Exploratory(x, omissionsAsReadings = FALSE, alternateReadings = TRUE) +# +# +# }) diff --git a/tests/testthat/test-PCC.R b/tests/testthat/test-PCC.R index 9c0410f..7232550 100644 --- a/tests/testthat/test-PCC.R +++ b/tests/testthat/test-PCC.R @@ -216,15 +216,15 @@ test_that("yields expected output on simple case (with conflicts)", { }) -test_that("PCC works on non numeric input", { - myData = structure(c("1", "1", "1", "1,3", "1", "1", "1", "1,3", "1", - "1", "1", "1,3", "1", "1", "1", "1,3", "2", "2", "1", "1,2", - "2", "2", "1", "1,2", "2", "2", "1", "1,2", "2", "2", "1", "1,2", - "2", "1,2", "1", "1", "2", "1,2", "1", "1", "2", "1,2", "1", - "1", "2", "1,2", "1", "1", "2", "2", "1", "2", "2", "2", "1", - "2", "2", "2", "1", "2", "2", "2", "1", "2", "1,2", "1", "2", - "3", "1,2", "1", "2", "3", "1,2", "1", "2", "3", "1,2", "1", - "2", "3"), .Dim = c(16L, 5L), .Dimnames = list(c("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16"), c("A", "D", "F", "T", "P"))) - PCC(myData, alternateReadings = TRUE) - -}) +# test_that("PCC works on non numeric input", { +# myData = structure(c("1", "1", "1", "1,3", "1", "1", "1", "1,3", "1", +# "1", "1", "1,3", "1", "1", "1", "1,3", "2", "2", "1", "1,2", +# "2", "2", "1", "1,2", "2", "2", "1", "1,2", "2", "2", "1", "1,2", +# "2", "1,2", "1", "1", "2", "1,2", "1", "1", "2", "1,2", "1", +# "1", "2", "1,2", "1", "1", "2", "2", "1", "2", "2", "2", "1", +# "2", "2", "2", "1", "2", "2", "2", "1", "2", "1,2", "1", "2", +# "3", "1,2", "1", "2", "3", "1,2", "1", "2", "3", "1,2", "1", +# "2", "3"), .Dim = c(16L, 5L), .Dimnames = list(c("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16"), c("A", "D", "F", "T", "P"))) +# PCC(myData, alternateReadings = TRUE) +# +# })