Skip to content

Commit

Permalink
drafting new tests for future version
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Baptiste-Camps committed Apr 10, 2019
1 parent 8faa11e commit 906eef3
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 12 deletions.
22 changes: 22 additions & 0 deletions tests/testthat/test-PCC.Exploratory.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
#
#
# })
24 changes: 12 additions & 12 deletions tests/testthat/test-PCC.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
#
# })

0 comments on commit 906eef3

Please sign in to comment.