Skip to content

Commit

Permalink
Closes #2472 Fixes to three testthat calls: multi-line desc does not …
Browse files Browse the repository at this point in the history
…work for expe… (#2473)

Fixes to three testthat calls: multi-line desc does not work for expect_snapshot; reduce to one line.
  • Loading branch information
esimms999-gsk authored Jul 3, 2024
1 parent ae13109 commit 37eaa73
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 12 deletions.
6 changes: 2 additions & 4 deletions tests/testthat/_snaps/derive_merged.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@
1 DIABP Diastolic Blood Pressure
i Run `admiral::get_not_mapped()` to access the full list.

# derive_var_merged_summary Test 28: error when relatioship is
incorrectly specificed 'one-to-one'
# derive_var_merged_summary Test 28: error incorrect 'one-to-one'

Code
derive_vars_merged(advs, dataset_add = adsl, by_vars = exprs(USUBJID),
Expand All @@ -111,8 +110,7 @@
! Each row in `dataset_add` must match at most 1 row in `dataset`.
i Row 1 of `dataset_add` matches multiple rows in `dataset`.

# derive_var_merged_summary Test 29: merge selected variables with
relatioship as 'one-to-one'
# derive_var_merged_summary Test 29: merge sel vars 'one-to-one'

Code
derive_vars_merged(adsl, dataset_add = advs, by_vars = exprs(USUBJID),
Expand Down
3 changes: 1 addition & 2 deletions tests/testthat/_snaps/derive_vars_transposed.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# derive_vars_transposed Test 3: filtering the merge dataset works
with relationship 'many-to-one'
# derive_vars_transposed Test 3: filter merge dataset 'many-to-one'

Code
derive_vars_transposed(dataset, dataset_merge, by_vars = exprs(USUBJID),
Expand Down
6 changes: 2 additions & 4 deletions tests/testthat/test-derive_merged.R
Original file line number Diff line number Diff line change
Expand Up @@ -687,8 +687,7 @@ test_that("derive_var_merged_summary Test 27: merge selected variables with
})

## Test 28: error when relatioship is incorrectly specificed 'one-to-one' ----
test_that("derive_var_merged_summary Test 28: error when relatioship is
incorrectly specificed 'one-to-one'", {
test_that("derive_var_merged_summary Test 28: error incorrect 'one-to-one'", {
expect_snapshot(
derive_vars_merged(advs,
dataset_add = adsl,
Expand All @@ -701,8 +700,7 @@ test_that("derive_var_merged_summary Test 28: error when relatioship is
})

## Test 29: merge selected variables with relatioship as 'one-to-one' ----
test_that("derive_var_merged_summary Test 29: merge selected variables with
relatioship as 'one-to-one'", {
test_that("derive_var_merged_summary Test 29: merge sel vars 'one-to-one'", {
expect_snapshot(
derive_vars_merged(adsl,
dataset_add = advs,
Expand Down
3 changes: 1 addition & 2 deletions tests/testthat/test-derive_vars_transposed.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ test_that("derive_vars_transposed Test 2: filtering the merge dataset works", {
})

## Test 3: filtering the merge dataset works with relationship 'many-to-one' ----
test_that("derive_vars_transposed Test 3: filtering the merge dataset works
with relationship 'many-to-one'", {
test_that("derive_vars_transposed Test 3: filter merge dataset 'many-to-one'", {
expect_snapshot(
derive_vars_transposed(
dataset,
Expand Down

0 comments on commit 37eaa73

Please sign in to comment.