-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix warning when
par()
is called without parameter (#238)
- Loading branch information
1 parent
ce73b80
commit bf0e738
Showing
5 changed files
with
36 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
test_that("with_par works as expected", { | ||
local_pdf(local_tempfile()) | ||
|
||
old <- par("pty") | ||
with_par(list(pty = "s"), { | ||
expect_equal(par("pty"), "s") | ||
}) | ||
expect_equal(par("pty"), old) | ||
dev.off() | ||
}) | ||
|
||
test_that("local_par works as expected", { | ||
local_pdf(local_tempfile()) | ||
|
||
old <- par("pty") | ||
local({ | ||
local_par(list(pty = "s")) | ||
expect_equal(par("pty"), "s") | ||
}) | ||
expect_equal(par("pty"), old) | ||
}) | ||
|
||
test_that("empty par doesn't give warning", { | ||
local_pdf(local_tempfile()) | ||
|
||
expect_no_warning(with_par(list(), par(pty="s"))) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters