Skip to content

Commit

Permalink
remove unnecessary error exaplanation
Browse files Browse the repository at this point in the history
produced notes/warnings with testthat 3.0
ref #312
  • Loading branch information
wibeasley committed Nov 19, 2020
1 parent 298d9af commit 5785a9a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions tests/testthat/test-read-batch-longitudinal.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ test_that("filter-numeric", {
expect_match(returned_object1$status_codes, regexp="200", perl=TRUE)
expect_true(returned_object1$records_collapsed=="", "A subset of records was not requested.")
expect_true(returned_object1$fields_collapsed=="", "A subset of fields was not requested.")
expect_equal(returned_object1$filter_logic, filter, "The filter was not correct.")
expect_equal(returned_object1$filter_logic, filter)
expect_match(returned_object1$outcome_messages, regexp=expected_outcome_message, perl=TRUE)

###########################
Expand All @@ -116,7 +116,7 @@ test_that("filter-numeric", {
expect_match(returned_object2$status_codes, regexp="200", perl=TRUE)
expect_true(returned_object2$records_collapsed=="", "A subset of records was not requested.")
expect_true(returned_object2$fields_collapsed=="", "A subset of fields was not requested.")
expect_equal(returned_object1$filter_logic, filter, "The filter was not correct.")
expect_equal(returned_object1$filter_logic, filter)
expect_match(returned_object2$outcome_messages, regexp=expected_outcome_message, perl=TRUE)
})

Expand All @@ -142,7 +142,7 @@ test_that("filter-character", {
expect_match(returned_object1$status_codes, regexp="200", perl=TRUE)
expect_true(returned_object1$records_collapsed=="", "A subset of records was not requested.")
expect_true(returned_object1$fields_collapsed=="", "A subset of fields was not requested.")
expect_equal(returned_object1$filter_logic, filter, "The filter was not correct.")
expect_equal(returned_object1$filter_logic, filter)
expect_match(returned_object1$outcome_messages, regexp=expected_outcome_message, perl=TRUE)

###########################
Expand All @@ -157,7 +157,7 @@ test_that("filter-character", {
expect_match(returned_object2$status_codes, regexp="200", perl=TRUE)
expect_true(returned_object2$records_collapsed=="", "A subset of records was not requested.")
expect_true(returned_object2$fields_collapsed=="", "A subset of fields was not requested.")
expect_equal(returned_object2$filter_logic, filter, "The filter was not correct.")
expect_equal(returned_object2$filter_logic, filter)
expect_match(returned_object2$outcome_messages, regexp=expected_outcome_message, perl=TRUE)
})

Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-read-batch-simple.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ test_that("col_types", {
if (update_expectation) save_expected(returned_object$data, path_expected)
expected_data_frame <- retrieve_expected(path_expected)

expect_equal(returned_object$data, expected=expected_data_frame, label="The returned data.frame should be correct", ) # dput(returned_object$data)
expect_equal(returned_object$data, expected=expected_data_frame, label="The returned data.frame should be correct") # dput(returned_object$data)
expect_true( returned_object$success)
expect_match(returned_object$status_codes, regexp="200", perl=TRUE)
expect_true( returned_object$records_collapsed=="", "A subset of records was not requested.")
Expand Down Expand Up @@ -375,7 +375,7 @@ test_that("filter-numeric", {
expect_match(returned_object$status_codes, regexp="200", perl=TRUE)
expect_true(returned_object$records_collapsed=="", "A subset of records was not requested.")
expect_true(returned_object$fields_collapsed=="", "A subset of fields was not requested.")
expect_equal(returned_object$filter_logic, filter, "The filter was not correct.")
expect_equal(returned_object$filter_logic, filter)
expect_match(returned_object$outcome_message, regexp=expected_outcome_message, perl=TRUE)
expect_true(returned_object$success)
})
Expand All @@ -397,7 +397,7 @@ test_that("filter-character", {
expect_match(returned_object$status_codes, regexp="200", perl=TRUE)
expect_true(returned_object$records_collapsed=="", "A subset of records was not requested.")
expect_true(returned_object$fields_collapsed=="", "A subset of fields was not requested.")
expect_equal(returned_object$filter_logic, filter, "The filter was not correct.")
expect_equal(returned_object$filter_logic, filter)
expect_match(returned_object$outcome_message, regexp=expected_outcome_message, perl=TRUE)
expect_true(returned_object$success)
})
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-read-oneshot-eav.R
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ test_that("filter-numeric", {
expect_equal(returned_object$raw_text, expected="", ignore_attr = TRUE) # dput(returned_object$raw_text)
expect_true(returned_object$records_collapsed=="", "A subset of records was not requested.")
expect_true(returned_object$fields_collapsed=="", "A subset of fields was not requested.")
expect_equal(returned_object$filter_logic, filter, "The filter was not correct.")
expect_equal(returned_object$filter_logic, filter)
expect_match(returned_object$outcome_message, regexp=expected_outcome_message, perl=TRUE)
expect_true(returned_object$success)
})
Expand All @@ -193,7 +193,7 @@ test_that("filter-character", {
expect_equal(returned_object$raw_text, expected="", ignore_attr = TRUE) # dput(returned_object$raw_text)
expect_true(returned_object$records_collapsed=="", "A subset of records was not requested.")
expect_true(returned_object$fields_collapsed=="", "A subset of fields was not requested.")
expect_equal(returned_object$filter_logic, filter, "The filter was not correct.")
expect_equal(returned_object$filter_logic, filter)
expect_match(returned_object$outcome_message, regexp=expected_outcome_message, perl=TRUE)
expect_true(returned_object$success)
})
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-read-oneshot.R
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ test_that("filter-numeric", {
expect_equal(returned_object$raw_text, expected="", ignore_attr = TRUE) # dput(returned_object$raw_text)
expect_true(returned_object$records_collapsed=="", "A subset of records was not requested.")
expect_true(returned_object$fields_collapsed=="", "A subset of fields was not requested.")
expect_equal(returned_object$filter_logic, filter, "The filter was not correct.")
expect_equal(returned_object$filter_logic, filter)
expect_match(returned_object$outcome_message, regexp=expected_outcome_message, perl=TRUE)
expect_true(returned_object$success)
})
Expand All @@ -302,7 +302,7 @@ test_that("filter-character", {
expect_equal(returned_object$raw_text, expected="", ignore_attr = TRUE) # dput(returned_object$raw_text)
expect_true(returned_object$records_collapsed=="", "A subset of records was not requested.")
expect_true(returned_object$fields_collapsed=="", "A subset of fields was not requested.")
expect_equal(returned_object$filter_logic, filter, "The filter was not correct.")
expect_equal(returned_object$filter_logic, filter)
expect_match(returned_object$outcome_message, regexp=expected_outcome_message, perl=TRUE)
expect_true(returned_object$success)
})
Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/test-utilities-replace_nas_with_explicit.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test_that("replace_nas_character_standard", {

a <- REDCapR:::replace_nas_with_explicit(a)
expect_equal(a, expected, label="The correct letters should have been replaced.")
expect_equal(class(a), "character", "The returned array should remain a character.")
expect_equal(class(a), "character")
})

test_that("replace_nas_factor_standard", {
Expand All @@ -28,7 +28,7 @@ test_that("replace_nas_factor_standard", {

a <- REDCapR:::replace_nas_with_explicit(a, create_factor=FALSE, add_unknown_level=TRUE)
expect_equal(a, expected, label="The correct letters should have been replaced.")
expect_equal(class(a), "factor", "The returned array should be a converted factor.")
expect_equal(class(a), "factor")
})

test_that("replace_nas_factor_create_not_existing", {
Expand All @@ -44,7 +44,7 @@ test_that("replace_nas_factor_create_not_existing", {

a <- REDCapR:::replace_nas_with_explicit(a, create_factor=TRUE, add_unknown_level=TRUE)
expect_equal(a, expected, label="The correct letters should have been replaced.")
expect_equal(class(a), "factor", "The returned array should be a converted factor.")
expect_equal(class(a), "factor")
})

test_that("replace_nas_factor_create_already_existing", {
Expand All @@ -60,7 +60,7 @@ test_that("replace_nas_factor_create_already_existing", {

a <- REDCapR:::replace_nas_with_explicit(a, create_factor=TRUE, add_unknown_level=TRUE)
expect_equal(a, expected, label="The correct letters should have been replaced.")
expect_equal(class(a), "factor", "The returned array should be a converted factor.")
expect_equal(class(a), "factor")
})

test_that("replace_nas_factor_not_yet", {
Expand Down

0 comments on commit 5785a9a

Please sign in to comment.