Skip to content

Commit

Permalink
Merge pull request #426 from pharmaverse/ophth_unit_tests
Browse files Browse the repository at this point in the history
ophth unit test fixes
  • Loading branch information
harriscw authored Dec 14, 2024
2 parents 2ac0f17 + 9eebf9a commit fb35f8b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: sdtmchecks
Title: Data Quality Checks for Study Data Tabulation Model (SDTM) Datasets
Version: 1.0.0
Version: 1.0.0.01
Authors@R: c(
person(given="Will",
family="Harris",
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# sdtmchecks 1.0.0.01 "CRAN Try"

## Refinements of existing data check functions

* Updates to several ophthalmology related checks


# sdtmchecks 1.0.0 "CRAN Try"


Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/test-check_ec_sc_lat.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ test_that("Function returns true when no errors are present", {
SCTESTCD = c("ELIGEYE", "FOCID", "", "ELIGEYE", "FOCID", ""),
SCCAT = c("STUDY EYE SELECTION", "STUDY EYE SELECTION", "",
"STUDY EYE SELECTION", "STUDY EYE SELECTION", ""),
SCORRES = c("LEFT", "OS", "", "RIGHT", "OD", ""),
SCSTRESC = c("LEFT", "OS", "", "RIGHT", "OD", ""),
SCDTC = "2021-01-01",
stringsAsFactors = FALSE)

Expand Down Expand Up @@ -47,7 +47,7 @@ test_that("Function returns false when errors are present", {
SCTESTCD = c("ELIGEYE", "FOCID", "", "ELIGEYE", "FOCID", ""),
SCCAT = c("STUDY EYE SELECTION", "STUDY EYE SELECTION", "",
"STUDY EYE SELECTION", "STUDY EYE SELECTION", ""),
SCORRES = c("LEFT", "OS", "", "RIGHT", "OD", ""),
SCSTRESC = c("LEFT", "OS", "", "RIGHT", "OD", ""),
SCDTC = "2021-01-01",
stringsAsFactors = FALSE)

Expand All @@ -72,7 +72,7 @@ test_that("Function returns false when errors are present", {
})


test_that("Function returns false when errors are present", {
test_that("Function returns false when missing required variables", {

sc <- data.frame(USUBJID = c(1,1,1,2,2,2,3),
SCTEST = c("Eye Meeting Eligibility Criteria",
Expand All @@ -86,7 +86,7 @@ test_that("Function returns false when errors are present", {
SCCAT = c("STUDY EYE SELECTION", "STUDY EYE SELECTION", "",
"STUDY EYE SELECTION",
"STUDY EYE SELECTION", "", "STUDY EYE SELECTION"),
SCORRES = c("LEFT", "OS", "", "RIGHT", "OD", "", "RIGHT"),
SCSTRESC = c("LEFT", "OS", "", "RIGHT", "OD", "", "RIGHT"),
SCDTC = "2021-01-01",
stringsAsFactors = FALSE)

Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/test-check_oe_sc_lat_count_fingers.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test_that("Returns true when no errors present", {
SCTESTCD = c("ELIGEYE", "FOCID", "", "ELIGEYE", "FOCID", ""),
SCCAT = c("STUDY EYE SELECTION", "STUDY EYE SELECTION", "",
"STUDY EYE SELECTION", "STUDY EYE SELECTION", ""),
SCORRES = c("LEFT", "OS", "", "RIGHT", "OD", ""),
SCSTRESC = c("LEFT", "OS", "", "RIGHT", "OD", ""),
SCDTC = rep("2021-01-01", 6),
stringsAsFactors = FALSE)

Expand Down Expand Up @@ -44,7 +44,7 @@ test_that("Returns false when errors present - 1", {
SCTESTCD = c("ELIGEYE", "FOCID", "", "ELIGEYE", "FOCID", ""),
SCCAT = c("STUDY EYE SELECTION", "STUDY EYE SELECTION", "",
"STUDY EYE SELECTION", "STUDY EYE SELECTION", ""),
SCORRES = c("LEFT", "OS", "", "RIGHT", "OD", ""),
SCSTRESC = c("LEFT", "OS", "", "RIGHT", "OD", ""),
SCDTC = rep("2021-01-01", 6),
stringsAsFactors = FALSE)

Expand Down Expand Up @@ -81,7 +81,7 @@ test_that("Returns false when errors present - 2", {
SCCAT = c("STUDY EYE SELECTION", "STUDY EYE SELECTION", "",
"STUDY EYE SELECTION", "STUDY EYE SELECTION",
"", "STUDY EYE SELECTION"),
SCORRES = c("LEFT", "OS", "", "RIGHT", "OD", "", "OS"),
SCSTRESC = c("LEFT", "OS", "", "RIGHT", "OD", "", "OS"),
SCDTC = "2021-01-01",
stringsAsFactors = FALSE)

Expand Down Expand Up @@ -153,7 +153,7 @@ test_that("Returns false when expected column not present - 2", {
SCTESTCD = c("ELIGEYE", "FOCID", "", "ELIGEYE", "FOCID", ""),
SCCAT = c("STUDY EYE SELECTION", "STUDY EYE SELECTION", "",
"STUDY EYE SELECTION", "STUDY EYE SELECTION", ""),
SCORRES = c("LEFT", "OS", "", "RIGHT", "OD", ""),
SCSTRESC = c("LEFT", "OS", "", "RIGHT", "OD", ""),
SCDTC = rep("2021-01-01", 6),
stringsAsFactors = FALSE)

Expand Down

0 comments on commit fb35f8b

Please sign in to comment.