Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ Suggests:
stringr,
devtools,
covr,
bit64
bit64,
withr
RoxygenNote: 7.3.2
Roxygen: list(markdown = TRUE)
VignetteBuilder: knitr
Expand Down
2 changes: 1 addition & 1 deletion R/identify.R
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ identify_differences <- function(
x = BASE,
y = COMP,
by = KEYS,
suffix = c(".x", ".y"),
suffixes = c(".x", ".y"),
sort = TRUE
)
if (nrow(DAT) == 0) {
Expand Down
88 changes: 88 additions & 0 deletions tests/testthat/_snaps/miscellaneous.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,50 @@



---

Code
diffdf(d5, d6, suppress_warnings = TRUE)
Output
Differences found between the objects!

Summary of BASE and COMPARE
==================================================================
PROPERTY BASE COMP
------------------------------------------------------------------
Name d5 d6
Class "tbl_df, tbl, data.frame" "tbl_df, tbl, data.frame"
Rows(#) 50 50
Columns(#) 2 2
------------------------------------------------------------------


Not all Values Compared Equal
=============================
Variable No of Differences
-----------------------------
dt1 25
-----------------------------


First 10 of 25 rows are shown in table below
===========================================================
VARIABLE ..ROWNUMBER.. BASE COMPARE
-----------------------------------------------------------
dt1 1 2010-11-19 19:39:15 UTC <NA>
dt1 3 1960-10-01 07:07:59 UTC <NA>
dt1 5 2056-01-25 04:51:33 UTC <NA>
dt1 7 2013-04-15 17:26:08 UTC <NA>
dt1 9 2047-04-11 19:04:11 UTC <NA>
dt1 11 2015-04-02 04:50:42 UTC <NA>
dt1 13 2022-03-16 00:42:50 UTC <NA>
dt1 15 1998-05-18 10:16:14 UTC <NA>
dt1 17 1981-05-17 14:42:57 UTC <NA>
dt1 19 1972-08-09 04:01:06 UTC <NA>
-----------------------------------------------------------



# `as_ascii_table() can handle missing dates (#132)

Code
Expand Down Expand Up @@ -461,3 +505,47 @@



---

Code
diffdf(d5, d6, suppress_warnings = TRUE)
Output
Differences found between the objects!

Summary of BASE and COMPARE
==================================================================
PROPERTY BASE COMP
------------------------------------------------------------------
Name d5 d6
Class "tbl_df, tbl, data.frame" "tbl_df, tbl, data.frame"
Rows(#) 50 50
Columns(#) 2 2
------------------------------------------------------------------


Not all Values Compared Equal
=============================
Variable No of Differences
-----------------------------
dt1 25
-----------------------------


First 10 of 25 rows are shown in table below
==============================================
VARIABLE ..ROWNUMBER.. BASE COMPARE
----------------------------------------------
dt1 1 2094-01-18 <NA>
dt1 3 1660-11-17 <NA>
dt1 5 2484-06-02 <NA>
dt1 7 2114-10-26 <NA>
dt1 9 2408-06-23 <NA>
dt1 11 2131-10-07 <NA>
dt1 13 2191-11-05 <NA>
dt1 15 1985-12-25 <NA>
dt1 17 1839-02-01 <NA>
dt1 19 1763-04-22 <NA>
----------------------------------------------



31 changes: 31 additions & 0 deletions tests/testthat/test-miscellaneous.R
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,38 @@ test_that("datetimes compare as expected", {
})


testthat::test_that("#138 - No partial arg matches", {
withr::local_options(
list(
warnPartialMatchArgs = TRUE,
warnPartialMatchDollar = TRUE,
warnPartialMatchAttr = TRUE
)
)

df1 <- data.frame(
index1 = c(0, 0, 1, 1),
index2 = c(1, 2, 1, 2),
value = c(1, 2, 3, 4),
value2 = c(1, 2, 3, 4)
)

df2 <- data.frame(
index1 = c(1, 1, 2, 2),
index2 = c(1, 2, 1, 2),
value = c(0, 1, 20, 3),
value2 = c(0, 1, 2, 333)
)

expect_no_condition({
diff_result <- diffdf::diffdf(
df1,
df2,
keys = c("index1", "index2"),
suppress_warnings = TRUE
)
})
})

test_that("`as_ascii_table() can handle missing datetimes (#132)", {
d1 <- tibble(
Expand Down
Loading