Skip to content

Commit

Permalink
updating tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RossanaTat committed Feb 29, 2024
1 parent 0a6d49c commit 1f30639
Showing 1 changed file with 47 additions and 1 deletion.
48 changes: 47 additions & 1 deletion tests/testthat/test-dplyr-joins.R
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ test_that("LEFT JOIN - unmatched throws error", {
relationship = "many-to-many",
by = "id1=id2",
unmatched = "error") |>
expect_no_error()
expect_error()

left_join(x = x1,
y = y1,
Expand All @@ -399,6 +399,23 @@ test_that("LEFT JOIN - unmatched throws error", {
unmatched = "error") |>
expect_error()


left_join(x = x4,
y = y4,
relationship = "many-to-many",
by = c("id2", "x"),
unmatched = "error") |>
expect_error()

left_join(x = x4,
y = y4,
relationship = "many-to-many",
by = c("id1=id2", "id2=id"),
unmatched = "error") |>
expect_error()



})


Expand Down Expand Up @@ -722,6 +739,21 @@ test_that("RIGHT JOIN - unmatched error", {
unmatched = "error") |>
expect_error()

right_join(x = x4,
y = y4,
relationship = "many-to-many",
by = c("id2", "x"),
unmatched = "error") |>
expect_error()

right_join(x = x4,
y = y4,
relationship = "many-to-many",
by = c("id1=id2", "id2=id"),
unmatched = "error") |>
expect_no_error()


})

#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -1602,5 +1634,19 @@ test_that("INNER JOIN - unmatched error", {
unmatched = "error") |>
expect_error()

inner_join(x = x4,
y = y4,
relationship = "many-to-many",
by = c("id2", "x"),
unmatched = "error") |>
expect_error()

inner_join(x = x4,
y = y4,
relationship = "many-to-many",
by = c("id1=id2", "id2=id"),
unmatched = "error") |>
expect_error()


})

0 comments on commit 1f30639

Please sign in to comment.