Skip to content

Commit 6606bc2

Browse files
authored
Merge pull request #1127 from stan-dev/fix-csv-test-data.table
Fix error message after data.table change
2 parents 240561e + 36d76f1 commit 6606bc2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/testthat/test-csv.R

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,12 @@ test_that("read_cmdstan_csv() fails if the file does not exist", {
8484
test_that("read_cmdstan_csv() fails with empty csv file", {
8585
file_path <- test_path("resources", "csv", "empty.csv")
8686
file.create(file_path)
87-
expect_error(read_cmdstan_csv(file_path),
88-
"Supplied CSV file is corrupt!")
87+
error_msg <- if (utils::packageVersion("data.table") >= "1.18.0") {
88+
"External command failed"
89+
} else {
90+
"Supplied CSV file is corrupt"
91+
}
92+
expect_error(read_cmdstan_csv(file_path), error_msg, fixed = TRUE)
8993
file.remove(file_path)
9094
})
9195

0 commit comments

Comments
 (0)