Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Aug 3, 2024
1 parent addec14 commit 74a69b5
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/testthat/test-check_dag.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,17 @@ test_that("check_dag", {
)
expect_snapshot(print(dag))
})

test_that("check_dag, cylic error", {

Check warning on line 36 in tests/testthat/test-check_dag.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=tests/testthat/test-check_dag.R,line=36,col=37,[brace_linter] Opening curly braces should never go on their own line and should always be followed by a new line.
expect_error(
check_dag(
y ~ x + b + c + d,
x ~ c + d,
b ~ x,
b ~ y,
outcome = "y",
exposure = "x",
adjusted = "c"
),
regex = "Model is cyclic"
})

Check warning on line 48 in tests/testthat/test-check_dag.R

View workflow job for this annotation

GitHub Actions / lint-changed-files / lint-changed-files

file=tests/testthat/test-check_dag.R,line=48,col=1,[error] unexpected '}'

0 comments on commit 74a69b5

Please sign in to comment.