Running ‘test-atomic.R’ [3s/6s]
  Comparing ‘test-atomic.Rout’ to ‘test-atomic.Rout.save’ ... OK
  Running ‘test-banner.R’ [1s/2s]
  Comparing ‘test-banner.Rout’ to ‘test-banner.Rout.save’ ... OK
  Running ‘test-capture.R’ [1s/2s]
  Comparing ‘test-capture.Rout’ to ‘test-capture.Rout.save’ ... OK
  Running ‘test-check.R’ [1s/1s]
  Comparing ‘test-check.Rout’ to ‘test-check.Rout.save’ ... OK
  Running ‘test-context.R’ [2s/3s]
  Comparing ‘test-context.Rout’ to ‘test-context.Rout.save’ ... OK
  Running ‘test-core.R’ [1s/1s]
  Comparing ‘test-core.Rout’ to ‘test-core.Rout.save’ ... OK
  Running ‘test-diffChr.R’ [2s/5s]
  Comparing ‘test-diffChr.Rout’ to ‘test-diffChr.Rout.save’ ... OK
  Running ‘test-diffDeparse.R’ [1s/2s]
  Comparing ‘test-diffDeparse.Rout’ to ‘test-diffDeparse.Rout.save’ ... OK
  Running ‘test-diffObj.R’ [2s/5s]
  Comparing ‘test-diffObj.Rout’ to ‘test-diffObj.Rout.save’ ... OK
  Running ‘test-diffPrint.R’ [4s/9s]
  Running ‘test-diffStr.R’ [3s/5s]
  Comparing ‘test-diffStr.Rout’ to ‘test-diffStr.Rout.save’ ... OK
  Running ‘test-file.R’ [1s/3s]
  Comparing ‘test-file.Rout’ to ‘test-file.Rout.save’ ... OK
  Running ‘test-guide.R’ [1s/2s]
  Comparing ‘test-guide.Rout’ to ‘test-guide.Rout.save’ ... OK
  Running ‘test-html.R’ [1s/2s]
  Comparing ‘test-html.Rout’ to ‘test-html.Rout.save’ ... OK
  Running ‘test-limit.R’ [2s/3s]
  Comparing ‘test-limit.Rout’ to ‘test-limit.Rout.save’ ... OK
  Running ‘test-methods.R’ [1s/2s]
  Comparing ‘test-methods.Rout’ to ‘test-methods.Rout.save’ ... OK
  Running ‘test-misc.R’ [1s/2s]
  Comparing ‘test-misc.Rout’ to ‘test-misc.Rout.save’ ... OK
  Running ‘test-pager.R’ [2s/4s]
  Comparing ‘test-pager.Rout’ to ‘test-pager.Rout.save’ ... OK
  Running ‘test-rdiff.R’ [1s/2s]
  Comparing ‘test-rdiff.Rout’ to ‘test-rdiff.Rout.save’ ... OK
  Running ‘test-s4.R’ [1s/2s]
  Comparing ‘test-s4.Rout’ to ‘test-s4.Rout.save’ ... OK
  Running ‘test-scaling.R’ [1s/1s]
  Running ‘test-ses.R’ [2s/3s]
  Comparing ‘test-ses.Rout’ to ‘test-ses.Rout.save’ ... OK
  Running ‘test-style.R’ [3s/6s]
  Comparing ‘test-style.Rout’ to ‘test-style.Rout.save’ ... OK
  Running ‘test-subset.R’ [1s/2s]
  Comparing ‘test-subset.Rout’ to ‘test-subset.Rout.save’ ... OK
  Running ‘test-summary.R’ [3s/6s]
  Comparing ‘test-summary.Rout’ to ‘test-summary.Rout.save’ ... OK
  Running ‘test-text.R’ [1s/1s]
  Comparing ‘test-text.Rout’ to ‘test-text.Rout.save’ ... OK
  Running ‘test-trim.R’ [1s/2s]
  Comparing ‘test-trim.Rout’ to ‘test-trim.Rout.save’ ... OK
  Running ‘test-warnings.R’ [1s/2s]
  Comparing ‘test-warnings.Rout’ to ‘test-warnings.Rout.save’ ... OK
  Running ‘zz-test-check.R’ [0s/1s]
Running the tests in ‘tests/test-diffPrint.R’ failed.
Complete output:
  > NAME <- "diffPrint"
  > source(file.path('_helper', 'init.R'))
  > 
  > # Note, atomic prints happen in different test file
  > 
  > # - Matrices -------------------------------------------------------------------
  > 
  > mx.2 <- matrix(1:100, ncol=2)
  > mx.4 <- mx.3 <- mx.2
  > mx.3[31, 2] <- 111L
  > 
  > mx.3a <- mx.3[-31, ]
  > set.seed(2)
  > mx.4[cbind(sample(1:50, 6), sample(1:2, 6, replace=TRUE))] <-
  +   sample(-(1:50), 6)
  > 
  > mx.5 <- matrix(1:9, 3)
  > mx.6 <- matrix(12:1, 4)
  > mx.6[4,] <- c(3L, 6L, 9L)
  > 
  > # single value difference
  > all.equal(as.character(diffPrint(mx.2, mx.3)), rdsf(100))
  [1] TRUE
  > # single value unified
  > all.equal(as.character(diffPrint(mx.2, mx.3, mode="unified")), rdsf(150))
  [1] TRUE
  > # single value context
  > all.equal(as.character(diffPrint(mx.2, mx.3, mode="context")), rdsf(175))
  [1] TRUE
  > # missing row
  > all.equal(as.character(diffPrint(mx.2, mx.3a)), rdsf(200))
  [1] TRUE
  > all.equal(as.character(diffPrint(mx.2, mx.3a, mode="unified")), rdsf(300))
  [1] TRUE
  > # More differences
  > 
  > all.equal(as.character(diffPrint(mx.2, mx.4)), rdsf(400))
  [1] TRUE
  > all.equal(as.character(diffPrint(mx.2, mx.4, mode="unified")), rdsf(500))
  [1] TRUE
  > # Testing alignments
  > all.equal(as.character(diffPrint(mx.5, mx.6)), rdsf(600))
  [1] TRUE
  > all.equal(as.character(diffPrint(mx.5, mx.6, mode="unified")), rdsf(700))
  [1] TRUE
  > all.equal(as.character(diffPrint(mx.5, mx.6, mode="context")), rdsf(800))
  [1] TRUE
  > # More complex matrix
  > set.seed(2)
  > A <- B <- matrix(sample(1:80), nrow=16)
  > B[cbind(sample(5:16, 4), sample(1:5, 4))] <- sample(30:80, 4)
  > 
  > all.equal(as.character(diffPrint(A, B)), rdsf(900))
  [1] TRUE
  > all.equal(as.character(diffPrint(A, B, mode="unified")), rdsf(1000))
  [1] TRUE
  > all.equal(as.character(diffPrint(A, B, mode="context")), rdsf(1100))
  [1] TRUE
  > # Style matrices
  > 
  > all.equal(as.character(diffPrint(diffobj:::.mx1, diffobj:::.mx2)), rdsf(1200))
  [1] TRUE
  > 
  > # - Lists ----------------------------------------------------------------------
  > 
  > all.equal(as.character(diffPrint(lst.1, lst.3)), rdsf(1300))
  [1] TRUE
  > all.equal(as.character(diffPrint(lst.1, lst.3, mode="unified")), rdsf(1400))
  [1] TRUE
  > all.equal(as.character(diffPrint(lst.4, lst.5)), rdsf(1500))
  [1] TRUE
  > all.equal(as.character(diffPrint(lst.4, lst.5, mode="context")), rdsf(1600))
  [1] TRUE
  > # Nested first element (https://github.com/brodieG/diffobj/issues/46)
  > all.equal(
  +   as.character(diffPrint(list(1, list(2, list(1:3))), list(list(list(1:3))))),
  +   rdsf(1650)
  + )
  [1] TRUE
  > # Interesting but relatively slow example so we don't actually run it in
  > # tests
  > 
  > # diffPrint(unclass(mdl1), unclass(mdl2))
  > # diffPrint(unclass(mdl1), unclass(mdl2), mode="unified")
  > 
  > # - Data Frames ----------------------------------------------------------------
  > 
  > all.equal(as.character(diffPrint(iris.s, iris.2)), rdsf(1700))
  [1] TRUE
  > all.equal(
  +   as.character(diffPrint(iris.s, iris.2, mode="sidebyside")), rdsf(1800)
  + )
  [1] TRUE
  > all.equal(as.character(diffPrint(iris.s, iris.c)), rdsf(1900))
  [1] TRUE
  > all.equal(as.character(diffPrint(iris.s, iris.3)), rdsf(2000))
  [1] TRUE
  > 
  > all.equal(
  +   as.character(diffPrint(iris.s, iris.3, mode="sidebyside")), rdsf(2100)
  + )
  [1] TRUE
  > all.equal(as.character(diffPrint(iris.s, iris.4, mode="unified")), rdsf(2150))
  [1] TRUE
  > all.equal(
  +   as.character(diffPrint(iris.s, iris.4, mode="sidebyside")), rdsf(2200)
  + )
  [1] TRUE
  > all.equal(
  +   as.character(diffPrint(iris.5, iris.4, mode="sidebyside")), rdsf(2250)
  + )
  [1] TRUE
  > all.equal(as.character(diffPrint(iris.3a, iris.4a)), rdsf(2300))
  [1] TRUE
  > all.equal(
  +   as.character(diffPrint(iris.s, iris.3, mode="sidebyside")), rdsf(2350)
  + )
  [1] TRUE
  > all.equal(as.character(diffPrint(iris.s, iris.s[-2])), rdsf(2370))
  [1] TRUE
  > # This one is interesting because the input is pathological because there
  > # is one line that matches exactly between the two and as such creates a
  > # matching hunk, but it really is matching by coincidence.
  > 
  > all.equal(
  +   as.character(diffPrint(iris.s, iris.s[-2], mode="sidebyside")), rdsf(2383)
  + )
  [1] TRUE
  > # Possible example where we may not want to trim the row headers (Issue #39)
  > all.equal(
  +   as.character(diffPrint(cars[1:5,], mtcars[1:5,], mode="sidebyside")),
  +   rdsf(2380)
  + )
  [1] TRUE
  > 
  > # - Guides ---------------------------------------------------------------------
  > 
  > # Most guides tests are in the guides file, but this confirms interface works
  > # when starting at `diffPrint` instead of internally
  > 
  > all.equal(
  +   as.character(
  +     diffPrint(
  +       iris.s, iris.4, mode="sidebyside", guides=function(x, y) integer()
  +   ) ),
  +   rdsf(2400)
  + )
  [1] TRUE
  > all.equal(
  +   as.character(diffPrint(iris.s, iris.4, mode="sidebyside", guides=FALSE)),
  +   rdsf(2500)
  + )
  [1] TRUE
  > 
  > # - Arrays
  > arr.1 <- arr.2 <- array(1:24, c(4, 2, 3))
  > arr.2[c(3, 20)] <- 99L
  > all.equal(as.character(diffPrint(arr.1, arr.2)), rdsf(2600))
  [1] TRUE
  > 
  > # - Mixed
  > all.equal(
  +   as.character(diffPrint(list(1, 2, 3), matrix(1:9, 3))),
  +   rdsf(2700)
  + )
  [1] TRUE
  > all.equal(
  +   as.character(diffPrint(list(25, 2, 3), matrix(1:9, 3))),
  +   rdsf(2800)
  + )
  [1] TRUE
  > all.equal(
  +   as.character(
  +     diffPrint(list(c(1, 4, 7), c(2, 5, 8), c(3, 6, 9)), matrix(1:9, 3))
  +   ),
  +   rdsf(2900)
  + )
  [1] TRUE
  > # - `unitizer` corner case -----------------------------------------------------
  > 
  > res1 <- structure(
  +   c(-1717, 101, 0.938678984853783),
  +   .Names = c("intercept", "slope", "rsq"), class = "fastlm"
  + )
  > res2 <- structure(
  +   c(-3.541306e+13, 701248600000, 0.938679),
  +   .Names = c("intercept", "slope", "rsq"), class = "fastlm"
  + )
  > all.equal(as.character(diffPrint(res1, res2)), rdsf(3000))
  [1] TRUE
  > all.equal(
  +   as.character(diffPrint(unname(res1), unname(res2))), rdsf(3100)
  + )
  [1] TRUE
  > 
  > # - factors and other meta -----------------------------------------------------
  > 
  > # Thanks Frank
  > 
  > all.equal(
  +   as.character(diffPrint(factor(1:100), factor(c(1:99, 101)))), rdsf(3200)
  + )
  [1] TRUE
  > f1 <- factor(1:100)
  > f2 <- factor(c(1:20, 22:99, 101))
  > all.equal(capture.output(diffPrint(f1, f2)), txtf(100))
  [1] TRUE
  > 
  > f3 <- factor(letters[1:10])
  > f4 <- factor(letters[1:10], levels=letters[1:11])
  > all.equal(capture.output(diffPrint(f3, f4)), txtf(150))
  [1] TRUE
  > 
  > # time series
  > 
  > nhtemp2 <- nhtemp
  > nhtemp2[c(5, 30)] <- -999
  > all.equal(capture.output(diffPrint(nhtemp, nhtemp2)), txtf(175))
  [1] TRUE
  > 
  > # Meta on both sides
  > 
  > print.diffobj_test_c1 <- function(x, ...) {
  +   writeLines(c("Header row 1", "header row 2"))
  +   print(c(x))
  +   writeLines(c("", "Footer row 1", "", "footer row2"))
  + }
  > m1 <- structure(1:30, class='diffobj_test_c1')
  > m2 <- structure(2:51, class='diffobj_test_c1')
  > all.equal(capture.output(diffPrint(m1, m2)), txtf(200), print=TRUE)
  [1] TRUE
  > 
  > # - Raw output -----------------------------------------------------------------
  > 
  > all.equal(
  +   as.character(diffPrint(letters, LETTERS, format="raw", pager="off")),
  +   rdsf(3300)
  + )
  [1] TRUE
  > # - Varying Widths -------------------------------------------------------------
  > 
  > all.equal(
  +   as.character(diffPrint(letters, LETTERS, format="raw", disp.width=40)),
  +   rdsf(3400)
  + )
  [1] TRUE
  > try(diffPrint(letters, LETTERS, disp.width=5))
  Error in diffPrint(target = letters, current = LETTERS, disp.width = 5) : 
    Arugment `disp.width` must be integer(1L) and 0, or between 10 and 10000
  > 
  > # - covr workaround ------------------------------------------------------------
  > 
  > # Needed so that the function definition stuff is marked as covered; really
  > # it shouldn't even be eligible for coverage, need to discuss further with
  > # jhester
  > 
  > invisible(diffobj:::make_diff_fun())
  > 
  > # - Encoding Issues ------------------------------------------------------------
  > 
  > # issue81, mixed UTF-8 ASCII, encoding a-acute in hex to avoid cross platform
  > # issues
  > 
  > a <- "G\xc3\xa1bor Cs\xc3\xa1rdi"
  > b <- sprintf("%s wow", a)
  > Encoding(a) <- 'UTF-8'
  > Encoding(b) <- 'UTF-8'
  > 
  > # No error
  > 
  > new <- (as.character(diffPrint(list(hell=a, b=NULL), list(hell=b, b=list()))))
  Error in base::nchar(strip_style(x), ...) : 
    number of characters is not computable in "bytes" encoding, element 1
  Calls: diffPrint ... nlines -> pmax -> nchar2 -> <Anonymous> -> <Anonymous>
  Execution halted
Running the tests in ‘tests/zz-test-check.R’ failed.
Complete output:
  > source('_helper/check.R')
  
  
  
  
  
  
  
  
  
  
  
  
  
  Error: .Rout files missing (failed?):
  'test-diffPrint.Rout'
  Execution halted