brodieG / vetr

Trust, but Verify
79 stars 2 forks source link

Nullify breaking on R-devel #96

Closed brodieG closed 6 years ago

brodieG commented 6 years ago

     - Failed -----------------------------------------------------------------------

     | The following test failed because the new evaluation does not match the
     | reference value from the store. Overwrite with new result ([Y]es, [N]o,
     | [P]rev, [B]rowse, [R]erun, [Q]uit, [H]elp)?

     > nullify(iris[1:10, ], 4)
     Sepal.Length Sepal.Width Petal.Length Petal.Width Species
     1 5.1 3.5 1.4 NULL setosa
     2 4.9 3.0 1.4 <NA> setosa
     3 4.7 3.2 1.3 <NA> setosa
     4 4.6 3.1 1.5 <NA> setosa
     5 5.0 3.6 1.4 <NA> setosa
     6 5.4 3.9 1.7 <NA> setosa
     7 4.6 3.4 1.4 <NA> setosa
     8 5.0 3.4 1.5 <NA> setosa
     9 4.4 2.9 1.4 <NA> setosa
     10 4.9 3.1 1.5 <NA> setosa
     Warning in format.data.frame(if (omit) x[seq_len(n0), , drop = FALSE] else x, :
     corrupt data frame: columns will be truncated or padded with NAs

     | Conditions mismatch:

     < .REF$conditions
     > .NEW$conditions
     @@ 1,5 / 1,6 @@
     Condition list with 1 condition:
     < 1. [print] Warning in format.data.frame(x, digits = digits, na.encode = FALSE)
     < : corrupt data frame: columns will be truncated or padded with NAs
     > 1. [print] Warning in format.data.frame(if (omit) x[seq_len(n0), , drop =
     > FALSE] else x, : corrupt data frame: columns will be truncated or padded
     > with NAs

     [print] means condition was issued by a print or show method for an auto-

     | State mismatch; see `.DIFF$state` for details.

     | User input required to proceed, but we are in non-interactive mode.

     | unitizer unchanged.

     | * Fail: nullify(iris[1:10, ], 4)
     | in 'unitizer/abstract.R'

     | Newly evaluated tests do not match unitizer (Pass: 1080, Fail: 1); see above
     | for more info, or run in interactive mode.

One of the builds failing:

using R Under development (unstable) (2018-08-11 r75106)
using platform: x86_64-pc-linux-gnu (64-bit)
using session charset: UTF-8
brodieG commented 6 years ago

This happened between r74699 and r75061

brodieG commented 6 years ago

Probably happened because of 75024:

$svn diff -r 75023:75024 library/base/R/dataframe.R 
Index: library/base/R/dataframe.R
===================================================================
--- library/base/R/dataframe.R  (revision 75023)
+++ library/base/R/dataframe.R  (revision 75024)
@@ -1477,7 +1477,7 @@

 print.data.frame <-
     function(x, ..., digits = NULL, quote = FALSE, right = TRUE,
-        row.names = TRUE)
+        row.names = TRUE, max = NULL)
 {
     n <- length(row.names(x))
     if(length(x) == 0L) {
@@ -1489,12 +1489,20 @@
    print.default(names(x), quote = FALSE)
    cat(gettext("<0 rows> (or 0-length row.names)\n"))
     } else {
+   if(is.null(max)) max <- getOption("max.print", 99999L)
    ## format.<*>() : avoiding picking up e.g. format.AsIs
-   m <- as.matrix(format.data.frame(x, digits = digits, na.encode = FALSE))
+   omit <- (n0 <- max %/% length(x)) < n
+   m <- as.matrix(
+       format.data.frame(if(omit) x[seq_len(n0), , drop=FALSE] else x,
+                 digits = digits, na.encode = FALSE))
    if(!isTRUE(row.names))
        dimnames(m)[[1L]] <-
-       if(isFALSE(row.names)) rep.int("", n) else row.names
+       if(isFALSE(row.names)) rep.int("", if(omit) n0 else n)
+       else row.names
    print(m, ..., quote = quote, right = right)
+   if(omit)
+       cat(" [ reached 'max' / getOption(\"max.print\") -- omitted",
+       n - n0, "rows ]\n")
     }
     invisible(x)
 }
@@ -1644,7 +1652,7 @@
    }
     }
     for(j in seq_along(cn)) {
-   left <- if(!lscalar) e1[[j]] else e1
+   left  <- if(!lscalar) e1[[j]] else e1
    right <- if(!rscalar) e2[[j]] else e2
    value[[j]] <- eval(f)
     }