Skip to content

Commit

Permalink
minor polish to basic unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eddelbuettel committed Jul 24, 2021
1 parent 1efa825 commit 5dd3ad4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion R/test.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Internal, not exported, function used by unit tests
test <- function(src = "cat(2 + 2)") {
system2(r(), c("-e", shQuote(src)), stdout = TRUE, stderr = TRUE)
system2(r(), paste("-e", shQuote(src)), stdout = TRUE)
}


Expand Down
5 changes: 3 additions & 2 deletions tests/simpleTests.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
if (unname(Sys.info()["sysname"]) == "Linux" &&
Sys.getenv("TRAVIS", "false") != "true" &&
Sys.getenv("CI", "false") != "true") {
library(littler)
stopifnot(file.exists(littler:::r()))
stopifnot(length(system2(littler:::r(), "--version", stdout=TRUE)) > 10) # 14 lines
stopifnot(identical(littler:::test(), "4")) # default test is cat(2+2)
stopifnot(as.numeric(littler:::test('cat(R.version$year)')) >= 2015)
stopifnot(as.numeric(littler:::test('cat(R.version$year)')) >= 2015)
}

0 comments on commit 5dd3ad4

Please sign in to comment.