Last updated on 2023-03-28 02:55:03 CEST.
Flavor | Version | Tinstall | Tcheck | Ttotal | Status | Flags |
---|---|---|---|---|---|---|
r-devel-linux-x86_64-debian-clang | 1.4-0 | 3.22 | 30.32 | 33.54 | OK | |
r-devel-linux-x86_64-debian-gcc | 1.4-0 | 2.47 | 23.47 | 25.94 | OK | |
r-devel-linux-x86_64-fedora-clang | 1.4-0 | 42.74 | OK | |||
r-devel-linux-x86_64-fedora-gcc | 1.4-0 | 40.09 | OK | |||
r-patched-linux-x86_64 | 1.4-0 | 2.77 | 29.53 | 32.30 | OK | |
r-release-linux-x86_64 | 1.4-0 | 3.32 | 29.91 | 33.23 | OK | |
r-release-macos-arm64 | 1.4-0 | 17.00 | OK | |||
r-release-macos-x86_64 | 1.4-0 | 26.00 | OK | |||
r-release-windows-x86_64 | 1.4-0 | 24.00 | 62.00 | 86.00 | OK | |
r-oldrel-macos-arm64 | 1.4-0 | 19.00 | OK | |||
r-oldrel-macos-x86_64 | 1.4-0 | 28.00 | OK | |||
r-oldrel-windows-ix86+x86_64 | 1.4-0 | 7.00 | 56.00 | 63.00 | ERROR |
Version: 1.4-0
Check: tests
Result: ERROR
Running 'documentation-tests.R' [0s]
Running 'getParseFun-tests.R' [0s]
Running 'getParseParent-tests.R' [0s]
Running 'interface-tests.R' [0s]
Running 'style-tests.R' [0s]
Running the tests in 'tests/style-tests.R' failed.
Complete output:
> ### roger: Automated grading of R scripts
> ###
> ### Tests for the validity of the style linters.
> ###
> ### AUTHORS: Jean-Christophe Langlois, Vincent Goulet <vincent.goulet@act.ulaval.ca>
> ### LICENSE: GPL 2 or later.
>
> library(roger)
>
> ## Tests are run by R CMD check in a non interactive session where
> ## parse data is thrown out by default.
> if (!interactive())
+ options(keep.source = TRUE)
>
> ###
> ### Tests for code free of style errors
> ###
>
> ## General expressions
> VALID_STYLE_FILE <- tempfile(fileext = ".R")
> cat(
+ "## Correct use of left assign token",
+ "x <- 2",
+ "y <- 3",
+ "z <- c(42, 43)",
+ "",
+ "## Correct use of spacing",
+ ## Operators
+ "x + y",
+ "x - y",
+ "x > y",
+ "x >= y",
+ "x < y",
+ "x <= y",
+ "x == y",
+ "x != y",
+ "x & y",
+ "x | y",
+ "x && y",
+ "x || y",
+ "c(42, 43) -> z",
+ "x %% y",
+ "x %*% y",
+ "x * y",
+ "x/y", # this one does not need surrounding spaces
+ "x^y", # this one does not need surrounding spaces
+ "x +",
+ "y",
+ "z[1",
+ "< 2]",
+ "x <- -2",
+ "2 + !TRUE",
+ "",
+ ## Parentheses
+ "sum(x)",
+ "1 + (x + y)",
+ "1 + ((x + y) * z)",
+ "1 + (z/(x + y))",
+ "1 + (z^(x + y))",
+ "1 + (sum(1:10))",
+ "1 + ((sum(1:10)))",
+ "if (x > 0) x + y",
+ "for (i in seq_along(z)) x[i] <- x[i] + 2",
+ "while (x < 2) x + 2",
+ "switch(2, 2 + 2, c(sum(x), diff(z)))",
+ "foo <- function(x) x^2",
+ "",
+ ## Square brackets
+ "z[1]",
+ "U <- matrix(1:4, ncol = 2)",
+ "U[2, ]",
+ "",
+ ## Commas
+ "paste('Hello',",
+ " ' World')",
+ "A <- array(24, 2:4)",
+ "A[1, , ]",
+ "A[, 1, ]",
+ "A[, , 1]",
+ "A[1, 1, ]",
+ "A[1, , 1]",
+ "A[, 1, 1]",
+ ## Trailing whitespace
+ "## There should be no whitespaces at the end of a line",
+ "",
+ ## Trailing blank lines
+ "## There should be no trailing blank lines in a file",
+ file = VALID_STYLE_FILE, sep = "\n")
> VALID_STYLE <- getSourceData(VALID_STYLE_FILE)
>
> ## R bracing style
> VALID_BRACE_R_FILE <- tempfile(fileext = ".R")
> cat(
+ "## Correct use of R style for braces",
+ "foo <- function(x, y)",
+ "{",
+ " if (x > 2)",
+ " {",
+ " x^2 + y^3",
+ " }",
+ " else",
+ " {",
+ " z <- 3",
+ " x^2 + y^3 + z^4",
+ " }",
+ "",
+ " {",
+ " 2 + 3",
+ " }",
+ "}",
+ "",
+ "function(x, y)",
+ "{",
+ " 2 + 3",
+ "}",
+ "",
+ "{",
+ " 2 + 3",
+ "}",
+ file = VALID_BRACE_R_FILE, sep = "\n")
> VALID_BRACE_R <- getSourceData(VALID_BRACE_R_FILE)
>
> ## 1TBS bracing style
> VALID_BRACE_1TBS_FILE <- tempfile(fileext = ".R")
> cat(
+ "## Correct use of 1TBS style for braces",
+ "bar <- function(x, y = 42) {",
+ " if (x < y) {",
+ " x + y",
+ " } else {",
+ " x - y",
+ " }",
+ "}",
+ "",
+ "function(x, y) {",
+ " 2 + 3",
+ "}",
+ file = VALID_BRACE_1TBS_FILE, sep = "\n")
> VALID_BRACE_1TBS <- getSourceData(VALID_BRACE_1TBS_FILE)
>
> ## Comments
> VALID_COMMENTS_FILE <- tempfile(fileext = ".R")
> cat(file = VALID_COMMENTS_FILE, '
+ ### comment
+ 2 + 3 # comment
+ 42 ## 42
+ a ### a
+ ##
+ ## a
+ #!
+ #! a
+ #"
+ #" a
+ #$
+ #$ a
+ #%
+ #% a
+ #&
+ #& a
+ #(
+ #( a
+ #)
+ #) a
+ #*
+ #* a
+ #+
+ #+ a
+ #,
+ #, a
+ #-
+ #- a
+ #.
+ #. a
+ #/
+ #/ a
+ #:
+ #: a
+ #;
+ #; a
+ #<
+ #< a
+ #=
+ #= a
+ #>
+ #> a
+ #?
+ #? a
+ #@
+ #@ a
+ #[
+ #[ a
+ #\
+ #\ a
+ #]
+ #] a
+ #^
+ #^ a
+ #_
+ #_ a
+ #`
+ #` a
+ #{
+ #{ a
+ #|
+ #| a
+ #}
+ #} a
+ #~
+ #~ a
+ ')
> VALID_COMMENTS <- getSourceData(VALID_COMMENTS_FILE)
>
> ## Magic numbers
> VALID_NOMAGIC_FILE <- tempfile(fileext = ".R")
> cat(
+ "SIZE <- 42",
+ "BAR <- 2^32",
+ "BAZ <- 2^32 - 1",
+ "FOOBAR0 <- 1234",
+ "FOO_BAR42 <- 32 - 1",
+ "FOO.BAR.1 <- 32 - 1",
+ "BÃ<c2><89>BÃ<c2><89> <- 42",
+ "Ã<c2><87>A_1 <- 32 - 1",
+ "Ã<c2><8c>Ã<c2><80>Ã<c2><99>.2 <- 2^32 - 1",
+ "42 -> SIZE",
+ "32 - 1 -> Ã<c2><87>A_1",
+ "2^32 - 1 -> Ã<c2><8c>Ã<c2><80>Ã<c2><99>.2",
+ "",
+ "x <- rnorm(SIZE)",
+ "x[1]",
+ "x[1] * 2",
+ "x[33]",
+ "x[-1] - x[-SIZE] == -1L",
+ "x * 100",
+ "for (i in 1:SIZE) x[1]",
+ "x <- numeric(0)",
+ "",
+ "x <- Inf",
+ "x <- NA",
+ "x <- NaN",
+ file = VALID_NOMAGIC_FILE, sep = "\n")
> VALID_NOMAGIC <- getSourceData(VALID_NOMAGIC_FILE)
Error in parse(file, encoding = encoding, keep.source = keep.source) :
D:\temp\Rtmp8A0LMU\file1381072dc41ff.R:7:2: unexpected input
6: FOO.BAR.1 <- 32 - 1
7: BÃ<c2><89>
^
Calls: getSourceData -> getParseData -> parse
Execution halted
Flavor: r-oldrel-windows-ix86+x86_64