Skip to content

Commit

Permalink
Merge branch 'master' into loo-moment-match
Browse files Browse the repository at this point in the history
  • Loading branch information
rok-cesnovar committed Jun 26, 2023
2 parents 66ff05a + 5f61efe commit d428b27
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions tests/testthat/helper-custom-expectations.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ expect_gq_output <- function(object, num_chains = NULL) {
}

expect_interactive_message <- function(object, regexp = NULL) {
# Non-interactive message suppression failing under Windows CI,
# temporarily skip message check only on Windows
if (os_is_windows() && !os_is_wsl()) {
return(object)
}
if (interactive()) {
expect_message(object = object, regexp = regexp)
} else {
Expand Down
9 changes: 7 additions & 2 deletions tests/testthat/test-json.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,13 @@ test_that("JSON output for data frame and matrix is correct", {
json_output_mat <- readLines(temp_file_df)
json_output_df <- readLines(temp_file_mat)
expect_identical(json_output_df, json_output_mat)
expect_known_output(cat(json_output_df, sep = "\n"),
file = test_path("answers", "json-df-matrix.json"))

# Floating-point error introduced in jsonlite 1.8.5
# https://github.com/jeroen/jsonlite/issues/420
if (packageVersion("jsonlite") != "1.8.5") {
expect_known_output(cat(json_output_df, sep = "\n"),
file = test_path("answers", "json-df-matrix.json"))
}
})

test_that("JSON output for list of vectors is correct", {
Expand Down

0 comments on commit d428b27

Please sign in to comment.