Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

capture output of tests on windows to "dev/null" #65

Open
matteodelucchi opened this issue Dec 19, 2023 · 0 comments
Open

capture output of tests on windows to "dev/null" #65

matteodelucchi opened this issue Dec 19, 2023 · 0 comments
Labels
good first issue Good for newcomers

Comments

@matteodelucchi
Copy link
Contributor

the pendent of "/dev/null" on windows is "nul".
https://stackoverflow.com/questions/4507312/how-to-redirect-stderr-to-null-in-cmd-exe

Currently, when the output of tests is captured in "/dev/null" the tests are omitted on windows.
Consider instead sth like this:

test_that("plot.abnDag() works.", {
  mydag <- createAbnDag(dag = ~a+b|a, data.df = data.frame("a"=1, "b"=1))

  if(.Platform$OS.type == "unix") {
    FILE <- "/dev/null"
  } else {
    FILE <- "nul"
  }
  capture.output({
    expect_no_error({
      plot(mydag)
      })
    },
    file = FILE)
})

Not sure this example works well...

@matteodelucchi matteodelucchi added the good first issue Good for newcomers label Dec 19, 2023
@matteodelucchi matteodelucchi transferred this issue from another repository Apr 9, 2024
@matteodelucchi matteodelucchi transferred this issue from furrer-lab/shuttle-abn Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant