Running 'test-atomic.R' [3s]
  Comparing 'test-atomic.Rout' to 'test-atomic.Rout.save' ... OK
  Running 'test-banner.R' [151s]
  Running 'test-capture.R' [1s]
  Comparing 'test-capture.Rout' to 'test-capture.Rout.save' ... OK
  Running 'test-check.R' [1s]
  Comparing 'test-check.Rout' to 'test-check.Rout.save' ... OK
  Running 'test-context.R' [149s]
  Running 'test-core.R' [1s]
  Comparing 'test-core.Rout' to 'test-core.Rout.save' ... OK
  Running 'test-diffChr.R' [2s]
  Comparing 'test-diffChr.Rout' to 'test-diffChr.Rout.save' ... OK
  Running 'test-diffDeparse.R' [1s]
  Comparing 'test-diffDeparse.Rout' to 'test-diffDeparse.Rout.save' ... OK
  Running 'test-diffObj.R' [159s]
  Running 'test-diffPrint.R' [5s]
  Comparing 'test-diffPrint.Rout' to 'test-diffPrint.Rout.save' ... OK
  Running 'test-diffStr.R' [173s]
  Running 'test-file.R' [1s]
  Comparing 'test-file.Rout' to 'test-file.Rout.save' ... OK
  Running 'test-guide.R' [162s]
  Running 'test-html.R' [1s]
  Comparing 'test-html.Rout' to 'test-html.Rout.save' ... OK
  Running 'test-limit.R' [1s]
  Comparing 'test-limit.Rout' to 'test-limit.Rout.save' ... OK
  Running 'test-methods.R' [160s]
  Running 'test-misc.R' [1s]
  Comparing 'test-misc.Rout' to 'test-misc.Rout.save' ... OK
  Running 'test-pager.R' [151s]
  Running 'test-rdiff.R' [1s]
  Comparing 'test-rdiff.Rout' to 'test-rdiff.Rout.save' ... OK
  Running 'test-s4.R' [1s]
  Comparing 'test-s4.Rout' to 'test-s4.Rout.save' ... OK
  Running 'test-scaling.R' [166s]
  Running 'test-ses.R' [2s]
  Comparing 'test-ses.Rout' to 'test-ses.Rout.save' ... OK
  Running 'test-style.R' [3s]
  Comparing 'test-style.Rout' to 'test-style.Rout.save' ... OK
  Running 'test-subset.R' [1s]
  Comparing 'test-subset.Rout' to 'test-subset.Rout.save' ... OK
  Running 'test-summary.R' [163s]
  Running 'test-text.R' [158s]
  Running 'test-trim.R' [1s]
  Comparing 'test-trim.Rout' to 'test-trim.Rout.save' ... OK
  Running 'test-warnings.R' [172s]
  Running 'zz-test-check.R' [0s]
Running the tests in 'tests/test-banner.R' failed.
Complete output:
  > NAME <- "banner"
  > source(file.path('_helper', 'init.R'))
  > 
  > # - Banner Capture ------------------------------------------------------------
  > 
  > ref <- as.character(
  +   diffPrint(1 + 2, letters, tar.banner="1 + 2", cur.banner="letters")
  + )
  > identical(as.character(diffPrint(1 + 2, letters)), ref)
  [1] TRUE
  > invisible(
  +   setMethod(
  +     "diffPrint", c("numeric", "character"),
  +     function(target, current, ...) callNextMethod()
  + ) )
  > identical(as.character(diffPrint(1 + 2, letters)), ref)
  [1] TRUE
  > isTRUE(
  +   !identical(as.character(diffPrint(1 + 2, LETTERS)), ref)
  + )
  [1] TRUE
  > 
  > proc.time()
     user  system elapsed 
     0.70    0.07    0.78 
Running the tests in 'tests/test-context.R' failed.
Complete output:
  > NAME <- "context"
  > source(file.path('_helper', 'init.R'))
  > 
  > # - interesting context values -------------------------------------------------
  > 
  > all.equal(
  +   as.character(diffChr(chr.9, chr.10, context=0)),
  +   rdsf(100)
  + )
  [1] TRUE
  > all.equal(
  +   as.character(diffChr(chr.9, chr.10, context=-1L)),
  +   rdsf(150)
  + )
  [1] TRUE
  > all.equal(
  +   as.character(diffChr(chr.9, chr.10, context="auto")),
  +   rdsf(200)
  + )
  [1] TRUE
  > all.equal(
  +   as.character(diffChr(chr.9, chr.10, context=0, mode="context")), rdsf(300)
  + )
  [1] TRUE
  > # - with line limit ------------------------------------------------------------
  > 
  > all.equal(
  +   as.character(diffChr(chr.9, chr.10, context="auto", line.limit=18)),
  +   rdsf(400)
  + )
  [1] TRUE
  > all.equal(
  +   as.character(diffChr(chr.9, chr.10, context="auto", line.limit=25)),
  +   rdsf(500)
  + )
  [1] TRUE
  > # default to min context
  > 
  > a <- b <- letters
  > b[c(3, 20)] <- LETTERS[c(3,20)]
  > all.equal(
  +   capture.output(
  +     show(diffChr(a, b, line.limit=c(20, 10), context='auto', format='raw'))
  +   ),
  +   txtf(100)
  + )
  [1] TRUE
  > # trim hunks in auto-context mode
  > 
  > a <- b <- letters
  > b[c(3, 10, 20)] <- LETTERS[c(3,10,20)]
  > all.equal(
  +   capture.output(show(
  +     diffChr(
  +       a, b, hunk.limit=c(2, 1), context=auto_context(1, 5), line.limit=20,
  +       format='raw'
  +     )
  +   )),
  +   txtf(200)
  + )
  [1] TRUE
  > # - error handling -------------------------------------------------------------
  > 
  > try(auto_context(min=-1, max=1:3)) # "`min` must be"
  Error in auto_context(min = -1, max = 1:3) : 
    Argument `min` must be integer(1L) and greater than zero
  > try(auto_context(min=1, max=1:3)) # "`max` must be"
  Error in auto_context(min = 1, max = 1:3) : 
    Argument `max` must be integer(1L) and not NA
  > 
  > 
  > proc.time()
     user  system elapsed 
     1.32    0.15    1.46 
Running the tests in 'tests/test-diffObj.R' failed.
Complete output:
  > NAME <- "diffObj"
  > source(file.path('_helper', 'init.R'))
  > 
  > # - simple diffobj -------------------------------------------------------------
  > 
  > # no diff for print
  > all.equal(as.character(diffObj(iris.s, iris.c)), rdsf(100))
  [1] TRUE
  > # no diff for str
  > all.equal(
  +   as.character(diffObj(1:100, c(1:99, 200L))), rdsf(200)
  + )
  [1] TRUE
  > # diffs for both and must pick one, first one is str, second is print
  > all.equal(
  +   as.character(diffObj(mdl1[7], mdl2[7])), rdsf(300)
  + )
  [1] TRUE
  > all.equal(as.character(diffObj(mdl1, mdl2)), rdsf(400))
  [1] TRUE
  > 
  > # - fits or doesn't ------------------------------------------------------------
  > 
  > # Note, the first test used to favor str until we handicapped print
  > all.equal(
  +   diffObj(matrix(1:20, ncol=2), matrix(2:21, ncol=2), line.limit=5)@capt.mode,
  +   "str"
  + )
  [1] TRUE
  > # test kinda slow, would be better to have one with smaller objects with print
  > # methods
  > 
  > all.equal(
  +   diffObj(mdl1, mdl2, line.limit=15, mode='unified')@capt.mode, "print"
  + )
  [1] TRUE
  > all.equal(diffObj(1:1000, 1000:1, line.limit=5)@capt.mode, "str")
  [1] TRUE
  > 
  > # - misc -----------------------------------------------------------------------
  > 
  > try(diffObj(1, 2, extra=list(TRUE))) # "extra"
  Error in .local(target, current, ...) : 
    Argument `extra` must be empty in `diffObj`.
  > 
  > # - print error ----------------------------------------------------------------
  > 
  > x <- structure("hello", class="diffobj_ogewlhgiadfl")
  > y <- structure("goodbye", class="diffobj_ogewlhgiadfl")
  > try(diffObj(x, y)) # "Error in calling .diffPrint."
  Error in print.diffobj_ogewlhgiadfl(structure("goodbye", class = "diffobj_ogewlhgiadfl")) : 
    failure
  Error in diffObj(target = x, current = y) : 
    Error in calling `diffPrint`: Failed attempting to get text representation of object: failure
  > 
  > # Random exmaples to think through `diffObj` output
  > 
  > diffObj(
  +   pairlist("`logical(2L)` should be length 2 (is 3)"),
  +   pairlist("be length 2 (is 3)")
  + )
  [33m<[39m [33mpairlist("`logical(2L)` should be l..[39m  [34m>[39m [34mpairlist("be length 2 (is 3)")[39m       
  [36m@@ 1,3 @@                              [39m  [36m@@ 1,3 @@                              [39m
    [90m[39m[[1]][90m[39m                                    [90m[39m[[1]][90m[39m                                
  [33m<[39m [90m[1] [39m[33m"`logical(2L)` should be length 2[39m[90m[39m  [34m>[39m [90m[1] [39m[34m"be length 2 (is 3)"[39m[90m[39m             
  [33m:[39m [90m[39m[33m (is 3)"[39m[90m[39m                               [90m~[39m                                      
                                                                                  
  > 
  > diffObj(
  +   pairlist("`matrix(integer(), nrow = 3)` should be matrix (is list)", "`list(character(1L), 1L)[[2]]` should be type \"integer-like\" (is \"character\")"),
  +   pairlist("be class \"matrix\" (is \"list\")", "be type \"integer-like\" (is \"character\") at index [[2]]")
  + )
  [33m<[39m [33mpairlist("`matrix(integer(), nrow =..[39m  [34m>[39m [34mpairlist("be class \"matrix\" (is \..[39m
  [36m@@ 1,6 @@                              [39m  [36m@@ 1,6 @@                              [39m
    [90m[39m[[1]][90m[39m                                    [90m[39m[[1]][90m[39m                                
  [33m<[39m [90m[1] [39m[33m"`matrix(integer(), nrow = 3)` sh[39m[90m[39m  [34m>[39m [90m[1] [39m[34m"be class \"matrix\"[39m [34m(is[39m [34m\[39m[34m"[39m[34mlist[39m[34m\[39m[34m"[39m[34m[39m[34m[39m[90m[39m
  [33m:[39m [90m[39m[33mould be matrix (is list)"[39m[90m[39m              [34m:[39m [90m[39m[34m[39m[34m[39m[34m[39m[34m[39m[34m[39m[34m[39m[34m[39m[34m)[39m[34m"[39m[90m[39m                                   
                                                                                  
    [90m[39m[[2]][90m[39m                                    [90m[39m[[2]][90m[39m                                
  [33m<[39m [90m[1] [39m[33m"`list(character(1L), 1L)[[2]]` s[39m[90m[39m  [34m>[39m [90m[1] [39m[34m"be type \"integer-like\"[39m (is \"c[34m[39m[34m[39m[34m[39m[90m[39m
  [33m:[39m [90m[39m[33mhould be type \"integer-like\"[39m (is \"[90m[39m  [34m:[39m [90m[39m[34m[39mharacter\") [34mat[39m [34mindex[39m [34m[[2]][39m"[90m[39m          
  [33m:[39m [90m[39m[33m[39mcharacter\")"[90m[39m                          [90m~[39m                                      
                                                                                  
  > 
  > proc.time()
     user  system elapsed 
     2.31    0.29    2.59 
Running the tests in 'tests/test-diffStr.R' failed.
Complete output:
  > NAME <- "diffStr"
  > source(file.path('_helper', 'init.R'))
  > 
  > # - lm models ------------------------------------------------------------------
  > 
  > # formula display changed
  > if(
  +   R.Version()$major >= 3 && R.Version()$minor >= "3.1" || R.Version()$major > 3
  + )
  +   all.equal(as.character(diffStr(mdl1, mdl2)), rdsf(100))
  [1] TRUE
  > 
  > # Too strict a line limit, can't get under
  > all.equal(
  +   as.character(diffStr(mdl1[7], mdl2[7], line.limit=10)), rdsf(200)
  + )
  [1] TRUE
  > # Now we can get under
  > all.equal(
  +   as.character(diffStr(mdl1[7], mdl2[7], line.limit=15)), rdsf(300)
  + )
  [1] TRUE
  > 
  > # - Simple structure -----------------------------------------------------------
  > #
  > # Character types
  > 
  > all.equal(as.character(diffStr(iris.c, iris.s)), rdsf(400))
  [1] TRUE
  > 
  > # - Strict width ---------------------------------------------------------------
  > # formula display changed
  > if(
  +   R.Version()$major >= 3 && R.Version()$minor >= "3.1" || R.Version()$major > 3
  + ) {
  +   c(
  +     all.equal(
  +       as.character(
  +         diffStr(mdl1, mdl2, extra=list(strict.width="wrap"), line.limit=30)
  +       ),
  +       rdsf(500)
  +     ),
  +     all.equal(
  +       as.character(
  +         diffStr(mdl1, mdl2, extra=list(strict.width="cut"), line.limit=30)
  +       ),
  +       rdsf(550)
  +   ) )
  + }
  [1] TRUE TRUE
  > # - max.diffs ------------------------------------------------------------------
  > 
  > invisible(diffStr(iris, mtcars, max.diffs=2)) # warn: "Exceeded diff limit"
  Warning message:
  Exceeded diff limit during diff computation (18 vs. 2 allowed); overall diff is likely not optimal 
  > 
  > # - max.level ------------------------------------------------------------------
  > 
  > all.equal(
  +   as.character(diffStr(mdl1[7], mdl2[7], extra=list(max.level="auto"))),
  +   rdsf(600)
  + )
  [1] TRUE
  > all.equal(
  +   as.character(diffStr(mdl1[7], mdl2[7], extra=list(max.level=2))),
  +   rdsf(700)
  + )
  [1] TRUE
  > # Has a difference, but can't get under; the second is just for reference
  > 
  > lst.1 <- lst.2 <- lst.3 <- list(a=list(b=list(c=list(d=list(e=list(25))))))
  > names(lst.2) <- "A"
  > 
  > all.equal(
  +   as.character(diffStr(lst.1, lst.2, line.limit=2)), rdsf(800)
  + )
  [1] TRUE
  > all.equal(
  +   as.character(diffStr(lst.1, lst.2, line.limit=2)), rdsf(900)
  + )
  [1] TRUE
  > # Test that initial run shows difference, but too big, but next one down
  > # doesn't so have to increase level
  > 
  > names(lst.3$a$b$c$d) <- "E"
  > all.equal(
  +   as.character(diffStr(lst.1, lst.3, line.limit=6)), rdsf(1000)
  + )
  [1] TRUE
  > 
  > # - No visible differences -----------------------------------------------------
  > 
  > all.equal(
  +   as.character(diffStr(1:100, c(1:99, 101L))), rdsf(1100)
  + )
  [1] TRUE
  > 
  > # - Quoted Objects -------------------------------------------------------------
  > 
  > all.equal(
  +   as.character(diffStr(quote(zz + 1), quote(zz + 3))),
  +   structure(
  +     c("\033[33m<\033[39m \033[33mstr(quote(zz +..\033[39m  \033[34m>\033[39m \033[34mstr(quote(zz +..\033[39m", "\033[36m@@ 1 @@           \033[39m  \033[36m@@ 1 @@           \033[39m", "\033[33m<\033[39m \033[90m\033[39m language zz + \033[33m1\033[39m\033[90m\033[39m  \033[34m>\033[39m \033[90m\033[39m language zz + \033[34m3\033[39m\033[90m\033[39m"
  +     ), len = 3L
  + ) )
  [1] TRUE
  > 
  > all.equal(
  +   as.character(diffStr(quote(x), quote(y))),
  +   structure(c("\033[33m<\033[39m \033[33mstr(quo..\033[39m  \033[34m>\033[39m \033[34mstr(quo..\033[39m", "\033[36m@@ 1 @@    \033[39m  \033[36m@@ 1 @@    \033[39m", "\033[33m<\033[39m \033[90m\033[39m symbol \033[33mx\033[39m\033[90m\033[39m  \033[34m>\033[39m \033[90m\033[39m symbol \033[34my\033[39m\033[90m\033[39m"), len = 3L)
  + )
  [1] TRUE
  > 
  > # - Spaces with punctuation ----------------------------------------------------
  > 
  > all.equal(
  +   capture.output(show(diffStr(list(a=1), list(a=1, cabera=3), format='raw'))),
  +   txtf(100)
  + )
  [1] TRUE
  > 
  > 
  > proc.time()
     user  system elapsed 
     3.15    0.14    3.29 
Running the tests in 'tests/test-guide.R' failed.
Complete output:
  > NAME <- "guides"
  > source(file.path('_helper', 'init.R'))
  > 
  > # - detect_2d_guides -----------------------------------------------------------
  > 
  > iris.dply <- c("Source: local data frame [150 x 5]", "Groups: Species [3]", "", "   Sepal.Length Sepal.Width", "          (dbl)       (dbl)", "1           5.1         3.5", "2           4.9         3.0", "3           4.7         3.2", "4           4.6         3.1", "5           5.0         3.6", "6           5.4         3.9", "7           4.6         3.4", "8           5.0         3.4", "9           4.4         2.9", "10          4.9         3.1", "..          ...         ...", "Variables not shown: Petal.Length", "  (dbl), Petal.Width (dbl), Species", "  (fctr)")
  > 
  > all.equal(diffobj:::detect_2d_guides(iris.dply), 4:5)
  [1] TRUE
  > # wrapping data table with separator (#96)
  > 
  > DT.txt <- c(
  +  "             V1        V2        V3",
  +  "   1: 0.3201122 0.6907066 0.5004968",
  +  "  ---                              ",
  +  "1000: 0.3547379 0.2836985 0.8121208",
  +  "            V4        V5",
  +  "   1: 0.331665 0.6788726",
  +  "  ---                   ",
  +  "1000: 0.553012 0.7789110"
  + )
  > all.equal(
  +  diffobj:::detect_2d_guides(DT.txt),
  +  c(1L, 5L)
  + )
  [1] TRUE
  > # Narrow width
  > 
  > old.opt <- options(width=40)
  > all.equal(diffobj:::detect_2d_guides(capture.output(iris)), c(1, 152))
  [1] TRUE
  > all.equal(
  +   diffobj:::detect_2d_guides(capture.output(USAccDeaths)), c(1, 8, 15)
  + )
  [1] TRUE
  > # Time series
  > all.equal(diffobj:::detect_2d_guides(capture.output(UKgas)), 1)
  [1] TRUE
  > # no row.names (#111)
  > 
  > df1 <- capture.output(print(data.frame(a=1:3), row.names=FALSE))
  > no.rn.guide <- diffobj:::detect_2d_guides(df1)  # no warning
  > all.equal(no.rn.guide, 1L)
  [1] TRUE
  > 
  > df2 <- capture.output(print(data.frame(x="A"), row.names=FALSE))
  > no.rn.guide.2 <- diffobj:::detect_2d_guides(df2)  # no warning
  > all.equal(no.rn.guide.2, 1L)
  [1] TRUE
  > options(old.opt)
  > 
  > # - detect_list_guides ---------------------------------------------------------
  > 
  > l.1 <- list(1, 1:3, matrix(1:3, 1))
  > l.2 <- list(a=1, list(1:3, b=4, c=list(1, b=2)), matrix(1:3, 1))
  > c.l.1 <- capture.output(l.1)
  > c.l.2 <- capture.output(l.2)
  > # cbind(c.l.2, seq_along(c.l.2) %in% diffobj:::detect_list_guides(c.l.2))
  > all.equal(diffobj:::detect_list_guides(capture.output(l.1)), c(1, 4, 7))
  [1] TRUE
  > all.equal(
  +   diffobj:::detect_list_guides(capture.output(l.2)),
  +   c(1, 5, 8, 12, 15, 20)
  + )
  [1] TRUE
  > 
  > # - detect_matrix_guides -------------------------------------------------------
  > mx3 <- mx4 <- mx5 <- mx5a <- mx11 <- matrix(
  +  c(
  +     "averylongwordthatcanlahblah", "causeasinglewidecolumnblah",
  +     "matrixtowrapseveraltimes", "inarrowscreen", "onceuponatime",
  +     "agreenduckflew", "overthemountains", "inalongofantelopes",
  +     "ineedthreemore", "entriesactually", "nowonlytwomore", "iwaswrongearlier"
  +   ),
  +   nrow=3, ncol=4
  + )
  > mx3.c <- capture.output(mx3)
  > all.equal(diffobj:::detect_matrix_guides(mx3.c, NULL), c(1, 5))
  [1] TRUE
  > 
  > dimnames(mx4) <- list(A=NULL, B=NULL)
  > mx4.c <- capture.output(mx4)
  > all.equal(
  +   diffobj:::detect_matrix_guides(mx4.c, dimnames(mx4)), c(1, 2, 6, 7)
  + )
  [1] TRUE
  > attr(mx5, "blah") <- letters[1:10]
  > mx5.c <- capture.output(mx5)
  > all.equal(
  +   diffobj:::detect_matrix_guides(mx5.c, dimnames(mx5)), c(1, 5)
  + )
  [1] TRUE
  > # Simple matrices that don't wrap
  > 
  > mx6 <- mx7 <- mx7.1 <- matrix(1:4, 2)
  > 
  > mx6.c <- capture.output(mx6)
  > all.equal(diffobj:::detect_matrix_guides(mx6.c, dimnames(mx6)), 1)
  [1] TRUE
  > 
  > dimnames(mx7) <- list(A=letters[1:2], B=LETTERS[25:26])
  > mx7.c <- capture.output(mx7)
  > all.equal(diffobj:::detect_matrix_guides(mx7.c, dimnames(mx7)), c(1, 2))
  [1] TRUE
  > 
  > dimnames(mx7.1) <- list(letters[1:2], B=LETTERS[25:26])
  > mx7.1.c <- capture.output(mx7.1)
  > all.equal(diffobj:::detect_matrix_guides(mx7.1.c, dimnames(mx7.1)), c(1, 2))
  [1] TRUE
  > 
  > # Single col matrix
  > 
  > mx8 <- matrix(1:2, 2)
  > 
  > mx8.c <- capture.output(mx8)
  > all.equal(diffobj:::detect_matrix_guides(mx8.c, dimnames(mx8)), 1)
  [1] TRUE
  > 
  > # Wrapping matrices with colnames
  > 
  > mx9 <- mx3
  > dimnames(mx9) <- list(A=letters[1:3], B=LETTERS[20:23])
  > mx9.c <- capture.output(mx9)
  > all.equal(
  +   diffobj:::detect_matrix_guides(mx9.c, dimnames(mx9)), c(1:2, 6:7)
  + )
  [1] TRUE
  > 
  > mx10 <- mx9
  > attr(mx10, "blah") <- matrix(1:4, 2)
  > mx10.c <- capture.output(mx10)
  > all.equal(
  +   diffobj:::detect_matrix_guides(mx10.c, dimnames(mx10)), c(1:2, 6:7)
  + )
  [1] TRUE
  > local({
  +   old.opt <- options(width=30L)
  +   on.exit(options(old.opt))
  +   attr(mx11, "blah") <- letters[1:15]
  +   mx11.c <- capture.output(mx11)
  + 
  +   all.equal(
  +     diffobj:::detect_matrix_guides(mx11.c, dimnames(mx11)), c(1, 5, 9, 13)
  +   )
  + })
  [1] TRUE
  > # - detect_array_guides --------------------------------------------------------
  > 
  > a.1 <- array(1:6, dim=c(2, 1, 3))
  > a.2 <- array(1:6, dim=c(2, 1, 3), dimnames=list(NULL, "X", LETTERS[1:3]))
  > a.3 <- array(
  +   1:6, dim=c(2, 1, 3),
  +   dimnames=list(rows=NULL, cols="X", LETTERS[1:3])
  + )
  > a.4 <- `attr<-`(a.3, "hello", "random attribute")
  > a.5 <- array(1:36, dim=c(6, 2, 3))
  > a.6 <- array(1:2, c(2, 1, 1))
  > c.a.1 <- capture.output(a.1)
  > c.a.2 <- capture.output(a.2)
  > c.a.3 <- capture.output(a.3)
  > c.a.4 <- capture.output(a.4)
  > c.a.5 <- capture.output(a.5)
  > c.a.6 <- capture.output(a.6)
  > # helper funs to vizualize the guide line detection
  > # viz_dag <- function(capt, obj)
  > #   cbind(
  > #     capt,
  > #     seq_along(capt) %in% diffobj:::detect_array_guides(capt, dimnames(obj))
  > #   )
  > # viz_dag(c.a.1, a.1)
  > # viz_dag(c.a.2, a.2)
  > # viz_dag(c.a.3, a.3)
  > # viz_dag(c.a.4, a.4)
  > # viz_dag(c.a.5, a.5)
  > # viz_dag(c.a.6, a.6)
  > all.equal(
  +   diffobj:::detect_array_guides(c.a.1, dimnames(a.1)),
  +   c(1L, 2L, 7L, 8L, 13L, 14L)
  + )
  [1] TRUE
  > all.equal(
  +   diffobj:::detect_array_guides(c.a.2, dimnames(a.2)),
  +   c(1L, 2L, 7L, 8L, 13L, 14L)
  + )
  [1] TRUE
  > all.equal(
  +   diffobj:::detect_array_guides(c.a.3, dimnames(a.3)),
  +   c(1L, 2L, 8L, 9L, 15L, 16L)
  + )
  [1] TRUE
  > all.equal(
  +   diffobj:::detect_array_guides(c.a.4, dimnames(a.4)),
  +   c(1L, 2L, 8L, 9L, 15L, 16L)
  + )
  [1] TRUE
  > all.equal(
  +   diffobj:::detect_array_guides(c.a.5, dimnames(a.5)),
  +   c(1L, 2L, 11L, 12L, 21L, 22L)
  + )
  [1] TRUE
  > all.equal(
  +   diffobj:::detect_array_guides(c.a.6, dimnames(a.6)),
  +   c(1L, 2L)
  + )
  [1] TRUE
  > # - detect_s4_guides -----------------------------------------------------------
  > 
  > setClass("gtest2", slots=c(hello="integer", `good bye`="list"))
  > setClass("gtest1",
  +   slots=c(
  +     sub.class="gtest2", blah="character", gah="list", sub.class.2="gtest2"
  + ) )
  > obj <- new(
  +   "gtest1",
  +   sub.class=new(
  +     "gtest2", hello=1:3, `good bye`=list("a", list(l1=5, l2="wow"))
  +   ),
  +   blah=letters, gah=list(one=1:10, two=LETTERS),
  +   sub.class.2=new(
  +     "gtest2", hello=3:1, `good bye`=list("B", list(l1=5, l2="wow"))
  +   )
  + )
  > # note at this point the nested stuff doesn't work, so we're just shooting for
  > # the simple match
  > 
  > c.1 <- capture.output(obj)
  > identical(
  +   diffobj:::detect_s4_guides(c.1, obj),
  +   c(1L, 2L, 21L, 25L, 34L)
  + )
  [1] TRUE
  > # small diff as that has a non-default show method
  > 
  > diff <- diffChr("a", "b", format='raw')
  > diff.out <- capture.output(show(diff))
  > all.equal(
  +   diffobj:::detect_s4_guides(diff.out, diff),
  +   integer()
  + )
  [1] TRUE
  > # - custom guide fun -----------------------------------------------------------
  > 
  > a <- b <- matrix(1:100)
  > b[50] <- -99L
  > 
  > fun1 <- function(x, y) c(1L, 14L, 53L)
  > 
  > all.equal(as.character(diffPrint(a, b, guides=fun1)), rdsf(100))
  [1] TRUE
  > if(getRversion() >= "3.2.2") {
  +   capture.output( # warn: "If you did not specify a `guides`"
  +     trim.err <-
  +       as.character(diffPrint(a, b, guides=function(x, y) stop("boom"))),
  +     type="message"
  +   )
  +   all.equal(trim.err, rdsf(200))
  + }
  [1] TRUE
  Warning message:
  In apply_guides(current, cur.capt, guide_fun) :
    `guides*` method produced an error when attempting to compute guide lines ; If you did not specify a `guides` function or define custom `guides*` methods contact maintainer (see `?guides`).  Proceeding without guides.
  > # "must produce an integer vector"
  > try(diffobj:::apply_guides(1:26, LETTERS, function(x, y) 35L))
  Error in diffobj:::apply_guides(1:26, LETTERS, function(x, y) 35L) : 
    `guides*` method must produce an integer vector containing unique index values for the `obj.as.chr` vector; If you did not specify a `guides` function or define custom `guides*` methods contact maintainer (see `?guides`).  Proceeding without guides.
  > 
  > # - errors ---------------------------------------------------------------------
  > 
  > try(guidesStr(1:26, rep(NA_character_, 26)))# "Cannot compute guides"
  Error in guidesStr(1:26, rep(NA_character_, 26)) : 
    Cannot compute guides if `obj.as.chr` contains NAs
  > try(guidesPrint(1:26, rep(NA_character_, 26)))# "Cannot compute guides"
  Error in guidesPrint(1:26, rep(NA_character_, 26)) : 
    Cannot compute guides if `obj.as.chr` contains NAs
  > 
  > # - corner cases ---------------------------------------------------------------
  > 
  > all.equal(
  +   diffobj:::split_by_guides(letters, integer()),
  +   list(structure(letters, idx=seq_along(letters)))
  + )
  [1] TRUE
  > try(guidesStr(1:26, rep(NA_character_, 26))) # "Cannot compute guides"
  Error in guidesStr(1:26, rep(NA_character_, 26)) : 
    Cannot compute guides if `obj.as.chr` contains NAs
  > try(guidesPrint(1:26, rep(NA_character_, 26))) # "Cannot compute guides"
  Error in guidesPrint(1:26, rep(NA_character_, 26)) : 
    Cannot compute guides if `obj.as.chr` contains NAs
  > 
  > # - issue 117 - 2d guide failure -----------------------------------------------
  > 
  > # Thanks to Sebastian Meyer (@bastician) for MRE
  > a <- b <- data.frame(ID = 0, value = 1)
  > b$value <- 2
  > a <- a[c(rep(1, 86), 2)]
  > b <- b[c(rep(1, 86), 2)]
  > diffPrint(a, b, mode = "unified", format='raw', context=0)
  < a            
  > b            
  @@ 16 / 16 @@  
  ~   value      
  < 1     1      
  > 1     2      
  > 
  > proc.time()
     user  system elapsed 
     0.84    0.12    0.95 
Running the tests in 'tests/test-methods.R' failed.
Complete output:
  > NAME <- "methods"
  > source(file.path('_helper', 'init.R'))
  > 
  > # try implementing methods that change default behavior outside of package
  > 
  > # - Force unified --------------------------------------------------------------
  > 
  > par.env <- new.env()
  > local(
  +   envir=par.env, {
  +   suppressWarnings(
  +     setClass(
  +       "testdiffobj", slots=c(a="integer"), where=par.env
  +   ) )
  +   # First check that we do actually output in side by side mode
  + 
  +   print(
  +     all.equal(
  +       as.character(diffObj(new("testdiffobj", a=1L), new("testdiffobj", a=2L))),
  +       rdsf(100)
  +   ) )
  +   # Now verify that with our new method, we get unified
  + 
  +   setMethod("diffObj", c("testdiffobj", "testdiffobj"),
  +     function(target, current, ...) {
  +       dots <- match.call(expand.dots=FALSE)[["..."]]
  +       if("mode" %in% names(dots))
  +         callNextMethod()
  +       else
  +         callNextMethod(target=target, current=current, ..., mode="unified")
  +     },
  +     where=par.env
  +   )
  +   on.exit(
  +     removeMethod("diffObj", c("testdiffobj", "testdiffobj"), where=par.env)
  +   )
  +   print(
  +     all.equal(
  +       as.character(diffObj(new("testdiffobj", a=1L), new("testdiffobj", a=2L))),
  +       rdsf(200)
  +     ) )
  +   # Make sure we can still get side by side?
  +   print(
  +     all.equal(
  +       as.character(
  +         diffObj(
  +           new("testdiffobj", a=1L), new("testdiffobj", a=2L), mode="sidebyside"
  +       ) ),
  +       rdsf(100)
  +   ) )
  +   try( #"Argument `mode` must be"
  +     diffObj(new("testdiffobj", a=1L), new("testdiffobj", a=2L), mode="hello")
  +   )
  + })
  [1] TRUE
  [1] TRUE
  [1] TRUE
  Error in diffObj(target = new("testdiffobj", a = 1L), current = new("testdiffobj",  : 
    Error in calling `diffStr`: Argument `mode` must be character(1L) and in `c("auto", "unified", "context", "sidebyside")`.
  > 
  > proc.time()
     user  system elapsed 
     0.84    0.10    0.93 
Running the tests in 'tests/test-pager.R' failed.
Complete output:
  > NAME <- "pager"
  > source(file.path('_helper', 'init.R'))
  > source(file.path('_helper', 'tools.R'))
  > 
  > # void pager, doesn't do anything, just to test side effect of writing to file
  > 
  > void <- function(x) NULL
  > 
  > # - Specifying pager -----------------------------------------------------------
  > 
  > style <- gdo("diffobj.style")
  > if(is.null(style)) style <- StyleAnsi8NeutralYb()
  > style@pager@file.ext <- "xyz"  # make pager identifiable
  > all.equal(
  +   diffChr(
  +     letters, LETTERS, style=style, pager="auto", interactive=TRUE
  +   )@etc@style@pager@file.ext,
  +   "xyz"
  + )
  [1] TRUE
  > all.equal(
  +   diffChr(
  +     letters, LETTERS, style=style, pager="off", interactive=TRUE
  +   )@etc@style@pager,
  +   PagerOff()
  + )
  [1] TRUE
  > identical(
  +   diffChr(
  +     letters, LETTERS, style=style, pager="auto", interactive=FALSE
  +   )@etc@style@pager,
  +   PagerOff()
  + )
  [1] TRUE
  > 
  > # - System Pagers --------------------------------------------------------------
  > 
  > less.orig <- Sys.getenv("LESS")
  > pager_mock <- function(...) {
  +   warning(Sys.getenv("LESS"))
  +   42
  + }
  > is(PagerSystem(), "PagerSystem")
  [1] TRUE
  > is(
  +   pg.less <- PagerSystemLess(pager=pager_mock, flags="VWF"),
  +   "PagerSystemLess"
  + )
  [1] TRUE
  > res <- pg.less@pager() # warning: "VWF$"
  Warning message:
  In pager.old(x) : -VWF
  > all.equal(res, 42)
  [1] TRUE
  > all.equal(less.orig, Sys.getenv("LESS"))
  [1] TRUE
  > all.equal(PagerSystemLess(pager=pager_mock)@flags, "R")
  [1] TRUE
  > 
  > try(PagerSystemLess(pager=pager_mock, flags=letters))
  Error in initialize(value, ...) : 
    Argument `flags` must be character(1L) and not NA
  > 
  > # - use_pager ------------------------------------------------------------------
  > 
  > local({
  +   suppressMessages(mock(diffobj:::console_lines, 10L))
  +   on.exit(suppressMessages(untrace(diffobj:::console_lines)))
  +   c(
  +     isTRUE(diffobj:::use_pager(PagerSystem(threshold=0L), 1L)),
  +     identical(diffobj:::use_pager(PagerSystem(threshold=50L), 25L), FALSE),
  +     isTRUE(diffobj:::use_pager(PagerSystem(threshold=-1L), 25L))
  +   )
  + })
  [1] TRUE TRUE TRUE
  > 
  > # - Setting LESS var -----------------------------------------------------------
  > 
  > local({
  +   less.orig <- Sys.getenv("LESS", unset=NA)
  +   old.opt <- options(crayon.enabled=FALSE)  # problems with crayon and LESS
  +   on.exit({
  +     diffobj:::reset_less_var(less.orig) # should be tested..., but super simple
  +     options(old.opt)
  +   })
  + 
  +   # Here we change the LESS variable even though we're mocking getenv
  + 
  +   Sys.unsetenv("LESS")
  +   a0 <- isTRUE(is.na(diffobj:::set_less_var("XF")))
  +   a <- all.equal(Sys.getenv("LESS"), "-XF")
  +   Sys.setenv(LESS="-X -F")
  +   b <- all.equal(diffobj:::set_less_var("VP"), "-X -F")
  +   c <- all.equal(Sys.getenv("LESS"), "-X -FVP")
  +   diffobj:::reset_less_var("-XF")
  +   d <- all.equal(Sys.getenv("LESS"), "-XF")
  +   diffobj:::reset_less_var(NA_character_)
  +   e <- all.equal(Sys.getenv("LESS"), "")
  +   Sys.setenv(LESS="-XF")
  +   f <- all.equal(diffobj:::set_less_var("V"), "-XF")
  +   g <- all.equal(Sys.getenv("LESS"), "-XFV")
  +   c(a0, a, b, c, d, e, f, g)
  + })
  [1] TRUE TRUE TRUE TRUE TRUE TRUE TRUE TRUE
  > 
  > # - viewer vs browser ----------------------------------------------------------
  > 
  > local({
  +   viewer <- function(x) "viewer"
  +   old.external <- options(viewer=viewer, browser=function(url) "browser")
  +   on.exit(options(old.external))
  +   suppressMessages(mock(diffobj::make_blocking, quote(fun)))
  +   on.exit(suppressMessages(untrace(diffobj::make_blocking)), add=TRUE)
  +   pager <- PagerBrowser()
  +   a <- all.equal(pager@pager("blah"), "viewer")
  +   options(viewer=NULL)
  +   b <- all.equal(pager@pager("blah"), "browser")
  +   options(viewer=function(x) stop("viewer error"))
  +   res <- pager@pager("blah") # warning: "IDE viewer"
  +   c <- all.equal(res, "browser")
  +   c(a, b, c)
  + })
  [1] TRUE TRUE TRUE
  Warning message:
  In pager@pager("blah") :
    IDE viewer failed with error viewer error; falling back to `browseURL`
  > 
  > # - blocking -------------------------------------------------------------------
  > 
  > # Note that readline just proceeds in non-interactive mode, which is why we
  > # need the mock here
  > 
  > local({
  +   suppressMessages(mock(diffobj:::interactive, FALSE))
  +   on.exit(suppressMessages(untrace(diffobj:::interactive)))
  +   suppressMessages(mock(diffobj:::readline, quote(warning("readline"))))
  +   on.exit(suppressMessages(untrace(diffobj:::readline)), add=TRUE)
  +   try(make_blocking("hello")) # "must be a function"
  +   try(make_blocking(identity, letters)) # "must be character\\(1L")
  +   try(make_blocking(identity, "a", "a")) # "must be TRUE"
  + 
  +   res <- make_blocking(sum)(1:10) # warn: "readline"
  +   a <- all.equal(sum(1:10), res)
  +   b <- isTRUE(
  +     withVisible(
  +       suppressWarnings(make_blocking(sum, invisible=FALSE)(1:10))
  +     )[['visible']]
  +   )
  +   c(a, b)
  + })
  Error in make_blocking("hello") : Argument `fun` must be a function
  Error in make_blocking(identity, letters) : 
    Argument `msg` must be character(1L) and not NA
  Error in make_blocking(identity, "a", "a") : 
    Argument `invisible.res` must be TRUE or FALSE
  [1] TRUE TRUE
  Warning message:
  In readline(msg) : readline
  > local({
  +   suppressMessages(mock(diffobj:::interactive, TRUE))
  +   on.exit(suppressMessages(untrace(diffobj:::interactive)))
  +   suppressMessages(mock(diffobj:::readline, quote(warning("readline"))))
  +   on.exit(suppressMessages(untrace(diffobj:::readline)), add=TRUE)
  +   show( # warn "readline"
  +     diffChr(
  +       "a", "b", format='raw',
  +       pager=list(pager=void, make.blocking=TRUE, threshold=0)
  +     )
  +   )
  +   show( # warn "readline"
  +     diffChr(
  +       "a", "b", format='html',
  +       pager=list(pager=void, make.blocking=NA, threshold=0)
  +   ) )
  +   show(diffChr("a", "b", format='html', pager=list(pager=void)))
  + })
  Warning messages:
  1: In readline(msg) : readline
  2: In readline(msg) : readline
  3: In readline(msg) : readline
  > # There should be no warnings in this lot
  > 
  > local({
  +   suppressMessages(mock(diffobj:::interactive, TRUE))
  +   on.exit(suppressMessages(untrace(diffobj:::interactive)))
  +   suppressMessages(mock(diffobj:::readline, quote(warning("readline"))))
  +   on.exit(suppressMessages(untrace(diffobj:::readline)), add=TRUE)
  +   f <- tempfile()
  +   on.exit(unlink(f), add=TRUE)
  +   show(  # no warning
  +     diffChr(
  +       "a", "b", format='html',
  +       pager=list(pager=void, make.blocking=NA, file.path=f)
  +   ) )
  +   show(  # no warning
  +     diffChr(
  +       "a", "b", format='html',
  +       pager=list(pager=void, make.blocking=FALSE, file.path=f)
  +   ) )
  +   show(  # no warning
  +     diffChr("a", "b", format='html', pager=list(pager=void, file.path=f))
  +   )
  + })
  > 
  > # - html page output -----------------------------------------------------------
  > 
  > pager <- PagerBrowser(
  +   pager=function(x) cat(readLines(x), sep="\n"), make.blocking=FALSE
  + )
  > all.equal(
  +   capture.output(show(diffChr("A", "B", pager=pager, style=StyleRaw()))),
  +   c("< \"A\"       > \"B\"     ", "@@ 1 @@     @@ 1 @@   ", "< A         > B       ")
  + )
  [1] TRUE
  > pager.warn <- PagerBrowser(
  +   pager=function(x) cat(readLines(x), sep="\n"), make.blocking=FALSE
  + )
  > try( # "Unable to instantiate `Style` object: Argument `js` .* is not a file"
  +   diffChr(
  +     "A", "B", pager=pager.warn, format="html", style=list(js="notafile")
  + ) )
  Error in diffChr(target = "A", current = "B", pager = pager.warn, format = "html",  : 
    Unable to instantiate `Style` object: Argument `js` ("notafile") is not a file
  > try( # "Unable to instantiate `Style` object: Argument `css` .* is not a file"
  +   diffChr(
  +     "A", "B", pager=pager.warn, format="html", style=list(css="notafile")
  +   )
  + )
  Error in diffChr(target = "A", current = "B", pager = pager.warn, format = "html",  : 
    Unable to instantiate `Style` object: Argument `css` ("notafile") is not a file
  > # Create objects that bypass the validation
  > 
  > style.obj.1 <- style.obj.2 <- StyleHtmlLightYb()
  > style.obj.1@css <- "notafile"
  > style.obj.2@js <- "notafile"
  > 
  > invisible(
  +   capture.output( # warn: "Unable to read provided css file"
  +     show(diffChr("A", "B", pager=pager.warn, style=style.obj.1))
  + ) )
  Warning messages:
  1: In file(con, "r") :
    cannot open file 'notafile': No such file or directory
  2: In .local(x, ...) :
    Unable to read provided css file "notafile" (error: cannot open the connection).
  > invisible(
  +   capture.output( # "Unable to read provided js file"
  +     show(diffChr("A", "B", pager=pager.warn, style=style.obj.2))
  + ) )
  Warning messages:
  1: In file(con, "r") :
    cannot open file 'notafile': No such file or directory
  2: In .local(x, ...) :
    Unable to read provided js file "notafile" (error: cannot open the connection).
  > # - pager_is_less --------------------------------------------------------------
  > 
  > is.less <- pager_is_less()
  > isTRUE(diffobj:::is.TF(is.less))
  [1] TRUE
  > 
  > less <- tryCatch(
  +   system2("which", "less", stdout=TRUE, stderr=TRUE),
  +   error=function(e) NULL, warning=function(e) NULL
  + )
  > sys.cat <- tryCatch(
  +   system2("which", "cat", stdout=TRUE, stderr=TRUE),
  +   error=function(e) NULL, warning=function(e) NULL
  + )
  > if(diffobj:::is.chr.1L(less) && file_test("-x", less)) {
  +   local({
  +     old.opt <- options(pager=less)
  +     on.exit(options(old.opt))
  + 
  +     # has to be stopifnot as we can't return TRUE for systems that don't
  +     # meet these requirements
  +     stopifnot(
  +       identical(diffobj:::pager_opt_default(), FALSE),
  +       isTRUE(pager_is_less())
  +     )
  +   })
  + }
  > if(diffobj:::is.chr.1L(sys.cat) && file_test("-x", sys.cat)) {
  +   local({
  +     old.opt <- options(pager=sys.cat)
  +     on.exit(options(old.opt))
  + 
  +     # has to be stopifnot as we can't return TRUE for systems that don't
  +     # meet these requirements
  +     stopifnot(
  +       identical(diffobj:::pager_opt_default(), FALSE),
  +       identical(pager_is_less(), FALSE)
  +     )
  +   })
  + }
  > ## force some checks
  > 
  > local({
  +   old.opt <- options(pager=NULL)
  +   on.exit(options(old.opt))
  +   identical(pager_is_less(), FALSE)
  + })
  [1] TRUE
  > identical(diffobj:::file_is_less(tempfile()), FALSE)
  [1] TRUE
  > 
  > # - file.path ------------------------------------------------------------------
  > 
  > f <- tempfile()
  > show(
  +   diffChr(
  +     "A", "B", format='raw',
  +     pager=list(pager=void, file.path=f, threshold=0L)
  + ) )
  > all.equal(
  +   readLines(f),
  +   c("< \"A\"       > \"B\"     ", "@@ 1 @@     @@ 1 @@   ",
  +     "< A         > B       ")
  + )
  [1] TRUE
  > show(  # No error on this one
  +   diffChr(
  +     "A", "B", format='raw',
  +     pager=list(pager=void, file.path=NA, threshold=0L)
  + ) )
  > try(Pager(file.path=letters)) # "must be length 1"
  Error in initialize(value, ...) : Argument `file.path` must be length 1.
  > try(Pager(file.path=1)) # "must be character"
  Error in initialize(value, ...) : Argument `file.path` must be character.
  > 
  > # - basic pager ----------------------------------------------------------------
  > 
  > local({
  +   f <- tempfile()
  +   on.exit(unlink(f))
  +   c(
  +     all.equal(
  +       capture.output(
  +         show(
  +           diffChr(
  +             1, 2, pager=Pager(file.path=f, threshold=0L),
  +             format='raw'
  +           )
  +       ) ),
  +       txtf(100)
  +     ),
  +     all.equal(txtf(100), readLines(f))
  +   )
  + })
  [1] TRUE TRUE
  > 
  > # - format-pager interaction ---------------------------------------------------
  > 
  > local({
  +   old.opt <- options(crayon.colors=7)
  +   crayon::num_colors(TRUE)
  +   on.exit({
  +     options(old.opt)
  +     crayon::num_colors(TRUE)
  +   })
  +   c(
  +     is(
  +       diffChr(1, 2, format='auto', pager="on", interactive=TRUE)@etc@style,
  +       "StyleHtml"
  +     ),
  +     is(
  +       diffChr(1, 2, format='auto', pager="on", interactive=FALSE)@etc@style,
  +       "StyleRaw"
  +     ),
  +     is(
  +       diffChr(
  +         1, 2, format='auto', pager=PagerBrowser(), interactive=FALSE
  +       )@etc@style,
  +       "StyleHtml"
  +     )
  +   )
  + })
  [1] TRUE TRUE TRUE
  > # - format-pager interaction 2 -------------------------------------------------
  > 
  > local({
  +   old.rs <- Sys.getenv('RSTUDIO', unset=NA)
  +   old.rsterm <- Sys.getenv('RSTUDIO_TERM', unset=NA)
  +   on.exit({
  +     if(is.na(old.rs)) {
  +       Sys.unsetenv('RSTUDIO')
  +     } else Sys.setenv('RSTUDIO'=old.rs)
  + 
  +     if(is.na(old.rsterm)) {
  +       Sys.unsetenv('RSTUDIO_TERM')
  +     } else Sys.setenv('RSTUDIO_TERM'=old.rsterm)
  +   })
  +   Sys.unsetenv('RSTUDIO')
  +   Sys.unsetenv('RSTUDIO_TERM')
  +   old.opt <- options(crayon.colors=8)
  +   crayon::num_colors(TRUE)
  +   on.exit({options(old.opt); crayon::num_colors(TRUE)}, add=TRUE)
  + 
  +   Sys.setenv(RSTUDIO='1')
  + 
  +   a <- c(
  +     is(
  +       diffChr(1, 2, format='auto', pager='on', interactive=TRUE)@etc@style,
  +       "StyleHtml"
  +     ),
  +     is(
  +       diffChr(1, 2, format='auto', interactive=FALSE)@etc@style,
  +       "StyleAnsi"
  +   ) )
  +   Sys.setenv(RSTUDIO_TERM='HELLO')
  +   crayon::num_colors(TRUE)
  + 
  +   c(
  +     a,
  +     is(
  +       diffChr(1, 2, format='auto', pager='on', interactive=TRUE)@etc@style,
  +       "StyleAnsi"
  +   ) )
  + })
  [1] TRUE TRUE TRUE
  > 
  > # - format-pager interaction 3 -------------------------------------------------
  > 
  > is(
  +   diffPrint(1:3, 3:1, format='auto', interactive=FALSE, term.colors=1)@etc@style,
  +   "StyleRaw"
  + )
  [1] TRUE
  > is(
  +   diffPrint(1:3, 3:1, format='auto', interactive=FALSE, term.colors=8)@etc@style,
  +   "StyleAnsi"
  + )
  [1] TRUE
  > 
  > # - Default pager writes to screen ---------------------------------------------
  > 
  > # issue132 thanks Bill Dunlap
  > 
  > local({
  +   f <- tempfile()
  +   on.exit(unlink(f))
  +   writeLines("hello world", f)
  + 
  +   all.equal(capture.output(new("Pager")@pager(f)), "hello world")
  + })
  [1] TRUE
  > 
  > 
  > proc.time()
     user  system elapsed 
     1.35    0.10    1.89 
Running the tests in 'tests/test-scaling.R' failed.
Complete output:
  > NAME <- "scaling"
  > source(file.path('_helper', 'init.R'))
  > 
  > # These tests are not actually run since they require manual intervention to
  > # check for browser rendering
  > 
  > # These tests should be run on as many browsers as possible as well as in
  > # RStudio, and consist of running the code and resizing the windows to see
  > # what happens
  > 
  > if(FALSE) { # prevent running
  +   # Text should be allowed to unfurl beyond native width
  + 
  +   diffStr(mdl1, mdl2, format="html")
  +   diffStr(mdl1, mdl2, format="html", style=list(scale=FALSE))
  + 
  +   diffPrint(c(mdl1), c(mdl2), format="html")
  + 
  +   # Revealed problems with pixel rounding in scaling
  + 
  +   diffPrint(letters[1:6], LETTERS[1:6], format="html")
  +   diffPrint(letters[1:6], LETTERS[1:6], format="html", style=list(scale=FALSE))
  + 
  +   # Revealed problems with gutter width computations; and scaling
  + 
  +   mx.2 <- matrix(1:100, ncol=4)
  +   mx.4 <- mx.3 <- mx.2
  +   mx.3[15, 2] <- 111L
  +   mx.3a <- mx.3[-5, ]
  +   diffPrint(mx.2, mx.3a, format="html")
  + 
  +   # summary stuff
  + 
  +   summary(diffPrint(letters, LETTERS, format="html"))
  +   summary(diffStr(mdl1, mdl2, format="html"))
  +   summary(diffPrint(c(mdl1), c(mdl2), format="html"))
  + 
  +   # Long banners
  + 
  +   diffPrint(
  +     1:20 + 100 + 100 + 100 + 100 + 100 + 100 + 100,
  +     2:20 + 100 + 100 + 100 + 100 + 100 + 100 + 100,
  +     format="html", style=list(scale=FALSE)
  +   )
  +   diffPrint(
  +     1:20 + 100 + 100 + 100 + 100 + 100 + 100 + 100,
  +     2:20 + 100 + 100 + 100 + 100 + 100 + 100 + 100,
  +     format="html"
  +   )
  +   # context
  + 
  +   diffPrint(
  +     1:20 + 100 + 100 + 100 + 100 + 100 + 100 + 100,
  +     2:20 + 100 + 100 + 100 + 100 + 100 + 100 + 100,
  +     format="html", mode="context"
  +   )
  + }
  > 
  > proc.time()
     user  system elapsed 
     0.48    0.14    0.56 
Running the tests in 'tests/test-summary.R' failed.
Complete output:
  > NAME <- "summary"
  > source(file.path('_helper', 'init.R'))
  > 
  > # Note, atomic prints happen in different test file
  > 
  > # - Any ------------------------------------------------------------------------
  > 
  > identical(any(diffPrint(iris.s, iris.s)), FALSE)
  [1] TRUE
  > res <- any(diffPrint(iris.s, iris.c)) # warn:  "objects are NOT"
  Warning message:
  No visible differences, but objects are NOT `all.equal`. 
  > identical(res, FALSE)
  [1] TRUE
  > isTRUE(any(diffPrint(iris.s, iris.4)))
  [1] TRUE
  > 
  > 
  > # - Small Summary --------------------------------------------------------------
  > 
  > all.equal(
  +   as.character(summary(diffPrint(iris.s, iris.4))), rdsf(100)
  + )
  [1] TRUE
  > all.equal(
  +   as.character(summary(diffPrint(iris.s, iris.2))), rdsf(200)
  + )
  [1] TRUE
  > all.equal(
  +   as.character(summary(diffPrint(iris.s, iris.3))), rdsf(300)
  + )
  [1] TRUE
  > all.equal(
  +   as.character(summary(diffPrint(iris.s, iris.c))), rdsf(400)
  + )
  [1] TRUE
  > # All equal
  > 
  > all.equal(
  +   as.character(summary(diffChr(letters, letters))), rdsf(450)
  + )
  [1] TRUE
  > 
  > # - Big Summary ----------------------------------------------------------------
  > 
  > # Make sure we test summary reduction, wrapping
  > 
  > all.equal(
  +   as.character(summary(diffChr(chr.7, chr.8))), rdsf(500)
  + )
  [1] TRUE
  > all.equal(
  +   as.character(summary(diffChr(chr.7, chr.8), scale.threshold=1)), rdsf(600)
  + )
  [1] TRUE
  > all.equal(
  +   as.character(summary(diffChr(chr.7, chr.8), scale.threshold=0)), rdsf(700)
  + )
  [1] TRUE
  > # Force truncation of summary
  > all.equal(
  +   as.character(
  +     summary(diffChr(chr.7, chr.8), scale.threshold=0, max.lines=2)
  +   ),
  +   rdsf(800)
  + )
  [1] TRUE
  > 
  > # - Show -----------------------------------------------------------------------
  > 
  > isTRUE(
  +   paste0(capture.output(summary(diffChr(chr.7, chr.8))), collapse="\n") ==
  +   as.character(summary(diffChr(chr.7, chr.8)))
  + )
  [1] TRUE
  > 
  > # - HTML summary ---------------------------------------------------------------
  > 
  > all.equal(
  +   as.character(
  +     summary(
  +       diffPrint(
  +         iris.s, iris.4, format="html", style=list(html.output="page")
  +   ) ) ),
  +   rdsf(900)
  + )
  [1] TRUE
  > 
  > # - errors ---------------------------------------------------------------------
  > 
  > diff <- diffChr("hello green world", "hello red world")
  > try(summary(diff, max.lines=0)) # "strictly positive"
  Error in .local(object, ...) : 
    Argument `max.lines` must be integer(1L) and strictly positive
  > try(summary(diff, width=1:3)) # "integer\\(1L\\)"
  Error in .local(object, ...) : 
    Argument `width` must be integer(1L) and positive
  > try(summary(diff, scale.threshold=5)) # "between 0 and 1"
  Error in .local(object, ...) : 
    Argument `scale.threshold` must be numeric(1L) between 0 and 1
  > 
  > # - width wrap -----------------------------------------------------------------
  > 
  > diff <- diffChr("hello green world", "hello red world", format='raw')
  > all.equal(capture.output(show(summary(diff, width=5))), txtf(100))
  [1] TRUE
  > 
  > 
  > proc.time()
     user  system elapsed 
     2.73    0.12    2.84 
Running the tests in 'tests/test-text.R' failed.
Complete output:
  > NAME <- "text"
  > source(file.path('_helper', 'init.R'))
  > 
  > # - simple wrap
  > 
  > txt1 <- c(
  +   "humpty dumpty sat on a wall and had a big fall",
  +   "humpty sat on a wall and dumped a big fall"
  + )
  > res1 <- diffobj:::wrap(txt1, 10, TRUE, sgr.supported=TRUE)
  > 
  > identical(
  +   gsub(" *$", "", vapply(res1, paste0, character(1L), collapse="")), txt1
  + )
  [1] TRUE
  > all.equal(lapply(res1, nchar), list(rep(10L, 5L), rep(10L, 5L)))
  [1] TRUE
  > 
  > txt2 <- "hello world!"
  > identical(
  +   unlist(diffobj:::wrap(txt2, nchar(txt2), TRUE, sgr.supported=TRUE)),
  +   txt2
  + )
  [1] TRUE
  > identical(
  +   paste0(
  +     unlist(diffobj:::wrap(txt2, nchar(txt2) / 2, TRUE, sgr.supported=TRUE)),
  +     collapse=""
  +   ),
  +   txt2
  + )
  [1] TRUE
  > 
  > # - wrap with escape sequences
  > 
  > txt3 <- c(
  +   paste0(
  +     "humpty dumpty ", crayon::style("sat on a wall", "red"),
  +     " and had a big fall",
  +     crayon::style(
  +       crayon::style(
  +         "humpty sat on a wall and dumped a big fall",
  +         "green"
  +       ),
  +       "bgRed"
  +     ), "woohoo"
  +   ),
  +   paste0(
  +     crayon::style("hello ", "inverse"), "beautiful ",
  +     crayon::style("world", "blue")
  +   )
  + )
  > res3 <- diffobj:::wrap(txt3, 10, TRUE, sgr.supported=TRUE)
  > 
  > identical(
  +   crayon::strip_style(
  +     gsub(" *$", "", vapply(res3, paste0, character(1L), collapse=""))
  +   ),
  +   crayon::strip_style(txt3)
  + )
  [1] TRUE
  > all.equal(
  +   lapply(res3, crayon::col_nchar),
  +   list(rep(10L, 10L), rep(10L, 3L))
  + )
  [1] TRUE
  > 
  > # - strip hz whitespace
  > 
  > options(crayon.enabled=FALSE)
  > all.equal(
  +   diffobj:::strip_hz_control("a\tb", stops=4L, sgr.supported=TRUE), "a   b")
  [1] TRUE
  > all.equal(
  +   diffobj:::strip_hz_control("ab\t", stops=4L, sgr.supported=TRUE), "ab  ")
  [1] TRUE
  > all.equal(
  +   diffobj:::strip_hz_control("a\tb\t", stops=4L, sgr.supported=TRUE), "a   b   ")
  [1] TRUE
  > all.equal(
  +   diffobj:::strip_hz_control("\ta\tb\t", stops=4L, sgr.supported=TRUE), 
  +   "    a   b   "
  + )
  [1] TRUE
  > all.equal(
  +   diffobj:::strip_hz_control("\ta\tb\t", stops=c(2L, 4L), sgr.supported=TRUE),
  +   "  a   b   "
  + )
  [1] TRUE
  > all.equal(
  +   diffobj:::strip_hz_control(
  +     c("ab\t", "\ta\tb\t"), sgr.supported=TRUE, stops=4L
  +   ),
  +   c("ab  ", "    a   b   ")
  + )
  [1] TRUE
  > # recall that nchar("\033") == 1
  > all.equal(
  +   diffobj:::strip_hz_control(
  +     "\033[31ma\t\033[39mhello\tb", stops=10L, sgr.supported=FALSE
  +   ),
  +   "\033[31ma    \033[39mhello          b"
  + )
  [1] TRUE
  > all.equal(
  +   diffobj:::strip_hz_control(
  +     "\033[31ma\t\033[39mhello\tb", stops=10L, sgr.supported=TRUE
  +   ),
  +   "\033[31ma\033[39m         \033[31m\033[39mhello     \033[31m\033[39mb"
  + )
  [1] TRUE
  > # carriage returns
  > 
  > all.equal(
  +   diffobj:::strip_hz_control("hellothere\rHELLO", sgr.supported=TRUE),
  +   "HELLOthere"
  + )
  [1] TRUE
  > all.equal(
  +   diffobj:::strip_hz_control(
  +     c("hellothere\rHELLO", "000\r12345678\rabcdef\rABC"), sgr.supported=TRUE
  +   ),
  +   c("HELLOthere", "ABCdef78")
  + )
  [1] TRUE
  > all.equal(
  +   diffobj:::strip_hz_control("hellothere\r", sgr.supported=TRUE),
  +   "hellothere"
  + )
  [1] TRUE
  > all.equal(
  +   diffobj:::strip_hz_control(character(), sgr.supported=TRUE), character()
  + )
  [1] TRUE
  > # newlines
  > 
  > all.equal(
  +   diffobj:::strip_hz_control(c("a", "", "\n", "a\nb"), sgr.supported=TRUE),
  +   c("a", "", "", "a", "b")
  + )
  [1] TRUE
  > # with colors
  > 
  > options(crayon.enabled=TRUE)
  > 
  > all.equal(
  +   crayon::strip_style(
  +     diffobj:::strip_hz_control(
  +       "\033[31ma\t\033[39mhello\tb", stops=10L, sgr.supported=TRUE)
  +   ),
  +   "a         hello     b"
  + )
  [1] TRUE
  > test.chr <- paste0(
  +   crayon::red(crayon::`%+%`("000",  crayon::bgBlue("\r12345678"))),
  +   "\rabcdef", crayon::green("\rABC")
  + )
  > # visually inspect these
  > 
  > # cat("\n")
  > # cat(test.chr, sep="\n")
  > res <- diffobj:::strip_hz_control(test.chr, sgr.supported=TRUE)
  > # cat(res, sep="\n")
  > all.equal(crayon::strip_style(res), "ABCdef78")
  [1] TRUE
  > 
  > # Mix tabs and carriage returns, visual inspection assumes terminal tab
  > # stops at 8L; note output not exactly the same since it seems tabs don't
  > # ovewrite prior screen state whereas spaces do
  > 
  > test.chr.2 <- paste0(
  +   crayon::red(crayon::`%+%`("000", crayon::bgBlue("\r123\t456\t78"))),
  +   "\rab\tcd f", crayon::green("\rABC")
  + )
  > # cat("\n")
  > # cat(test.chr.2, sep="\n")
  > res.2 <- diffobj:::strip_hz_control(test.chr.2, stops=8L, sgr.supported=TRUE)
  > # cat(res.2, sep="\n")
  > 
  > all.equal(crayon::strip_style(res.2), "ABC     cd f    78")
  [1] TRUE
  > 
  > # multi line
  > 
  > test.chr.3 <- c(test.chr, test.chr.2)
  > # cat("\n")
  > res.3 <- diffobj:::strip_hz_control(test.chr.3, sgr.supported=TRUE)
  > # cat(res.3, sep="\n")
  > # cat(test.chr.3, sep="\n")
  > 
  > all.equal(crayon::strip_style(res.3), c("ABCdef78", "ABC     cd f    78"))
  [1] TRUE
  > 
  > 
  > proc.time()
     user  system elapsed 
     0.45    0.12    0.56 
Running the tests in 'tests/test-warnings.R' failed.
Complete output:
  > NAME <- "warnings"
  > source(file.path('_helper', 'init.R'))
  > 
  > # tests designed to produce warnings
  > 
  > # - Extra args for `str` -------------------------------------------------------
  > 
  > a <- "hello"
  > b <- "goodbye"
  > 
  > invisible(diffStr(a, b, extra=list(comp.str="^"))) # "Specifying"
  Warning message:
  In capt_fun(target, current, etc = etc.proc, err = err, extra) :
    Specifying `comp.str` may cause `str` output level folding to be incorrect
  > invisible(diffStr(a, b, extra=list(comp="^"))) #  "Specifying")
  Warning messages:
  1: In match.call(definition, call, expand.dots, envir) :
    partial argument match of 'comp' to 'comp.str'
  2: In capt_fun(target, current, etc = etc.proc, err = err, extra) :
    Specifying `comp.str` may cause `str` output level folding to be incorrect
  > invisible(diffStr(a, b, extra=list(indent.str="..."))) #  "Specifying"
  Warning message:
  In capt_fun(target, current, etc = etc.proc, err = err, extra) :
    Specifying `indent.str` may cause `str` output level folding to be incorrect
  > invisible(diffStr(a, b, extra=list(indent="..."))) # "Specifying"
  Warning messages:
  1: In match.call(definition, call, expand.dots, envir) :
    partial argument match of 'indent' to 'indent.str'
  2: In capt_fun(target, current, etc = etc.proc, err = err, extra) :
    Specifying `indent.str` may cause `str` output level folding to be incorrect
  > 
  > # - Max diffs ------------------------------------------------------------------
  > 
  > # Max limit warnings work properly; these are not fully fleshed out
  > 
  > A3 <- c("a b c", "d e f A B C D", "g h i", "f")
  > B3 <- c("a b c", "xd e f E Q L S", "g h i", "q")
  > 
  > invisible(diffChr(A3, B3, max.diffs=2)) # warn: "Exceeded diff"
  Warning message:
  Exceeded diff limit during diff computation (6 vs. 2 allowed); overall diff is likely not optimal 
  > 
  > # - Overriden formals ----------------------------------------------------------
  > 
  > # warn "Provided `style` argument will override the provided `format` argument"
  > invisible(diffChr(letters, LETTERS, style=StyleRaw(), format="ansi8"))
  Warning message:
  In diffChr(target = letters, current = LETTERS, style = StyleRaw(),  :
    Provided `style` argument will override the provided `format` argument
  > 
  > # warn: "Provided `style` .* `format` and `color.mode` arguments"
  > invisible(
  +   diffChr(letters, LETTERS, style=StyleRaw(), format="ansi8", color.mode="rgb")
  + )
  Warning message:
  In diffChr(target = letters, current = LETTERS, style = StyleRaw(),  :
    Provided `style` argument will override the provided `format` and `color.mode` arguments.
  > 
  > 
  > proc.time()
     user  system elapsed 
     0.78    0.18    0.92 
Running the tests in 'tests/zz-test-check.R' failed.
Complete output:
  > source('_helper/check.R')
  
  
  
  
  
  
  
  
  
  
  
  
  
  Error: .Rout files missing (failed?):
  'test-banner.Rout', 'test-context.Rout', 'test-diffObj.Rout', 'test-diffStr.Rout', 'test-guide.Rout', 'test-methods.Rout', 'test-pager.Rout', 'test-summary.Rout', 'test-text.Rout', 'test-warnings.Rout'
  Execution halted