-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
On windows, unicode only on 4.2 and later
- Loading branch information
Showing
1 changed file
with
39 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,49 @@ | ||
test_that("local_reproducible_output() respects local context", { | ||
test_that("local_reproducible_output() respects local context", { | ||
|
||
local_reproducible_output(width = 105) | ||
expect_equal(getOption("width"), 105) | ||
local_reproducible_output(width = 105) | ||
expect_equal(getOption("width"), 105) | ||
|
||
local({ | ||
local_reproducible_output(width = 110) | ||
expect_equal(getOption("width"), 110) | ||
local({ | ||
local_reproducible_output(width = 110) | ||
expect_equal(getOption("width"), 110) | ||
}) | ||
|
||
expect_equal(getOption("width"), 105) | ||
}) | ||
|
||
expect_equal(getOption("width"), 105) | ||
}) | ||
test_that("local_envvar respects local context", { | ||
local_envvar(test = "a") | ||
expect_equal(Sys.getenv("test"), "a") | ||
|
||
test_that("local_envvar respects local context", { | ||
local_envvar(test = "a") | ||
expect_equal(Sys.getenv("test"), "a") | ||
local({ | ||
local_envvar(test = "b") | ||
expect_equal(Sys.getenv("test"), "b") | ||
}) | ||
|
||
local({ | ||
local_envvar(test = "b") | ||
expect_equal(Sys.getenv("test"), "b") | ||
}) | ||
expect_equal(Sys.getenv("test"), "a") | ||
local({ | ||
local_envvar(test = NA) | ||
expect_equal(Sys.getenv("test"), "") | ||
}) | ||
|
||
expect_equal(Sys.getenv("test"), "a") | ||
local({ | ||
local_envvar(test = NA) | ||
expect_equal(Sys.getenv("test"), "") | ||
expect_equal(Sys.getenv("test"), "a") | ||
}) | ||
|
||
expect_equal(Sys.getenv("test"), "a") | ||
}) | ||
|
||
test_that("local_collate respects local context", { | ||
locale <- switch(Sys.info()[["sysname"]], | ||
Darwin = , | ||
Linux = "en_US.UTF-8", | ||
Windows = "en-US" | ||
) | ||
skip_if(is.null(locale), "Don't know good locale to use for this platform") | ||
local_collate("C") | ||
expect_equal(Sys.getlocale("LC_COLLATE"), "C") | ||
|
||
local({ | ||
local_collate(locale) | ||
expect_equal(Sys.getlocale("LC_COLLATE"), locale) | ||
test_that("local_collate respects local context", { | ||
locale <- switch(Sys.info()[["sysname"]], | ||
Darwin = , | ||
Linux = "en_US.UTF-8", | ||
Windows = if (getRversion() >= "4.2") "en-US" | ||
) | ||
skip_if(is.null(locale), "Don't know good locale to use for this platform") | ||
|
||
local_collate("C") | ||
expect_equal(Sys.getlocale("LC_COLLATE"), "C") | ||
|
||
local({ | ||
local_collate(locale) | ||
expect_equal(Sys.getlocale("LC_COLLATE"), locale) | ||
}) | ||
|
||
expect_equal(Sys.getlocale("LC_COLLATE"), "C") | ||
}) | ||
|
||
expect_equal(Sys.getlocale("LC_COLLATE"), "C") | ||
}) |