-
Notifications
You must be signed in to change notification settings - Fork 323
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* sketch for reporting bare expectations * optional wrap argument * use NULL as test description for wrapped tests to avoid nested start_test() and end_test() calls * only wrap from test_files() * output * wrap = TRUE is the default * NEWS * document wrap argument to test_file() * only call skip_empty() if not wrapped * adapt encoding tests * document * markdown * adapt tests
- Loading branch information
Showing
17 changed files
with
60 additions
and
43 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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,17 +1,17 @@ | ||
context("encoding") | ||
|
||
test_that("can source file with Latin-1 encoding", { | ||
expect_error(test_file("latin1.R", "stop", encoding = "latin1"), NA) | ||
expect_error(test_file("latin1.R", "stop", encoding = "latin1", wrap = FALSE), NA) | ||
}) | ||
|
||
test_that("can source file with UTF-8 encoding", { | ||
expect_error(test_file("utf8.R", "stop", encoding = "UTF-8"), NA) | ||
expect_error(test_file("utf8.R", "stop", encoding = "UTF-8", wrap = FALSE), NA) | ||
}) | ||
|
||
test_that("error with Latin-1 encoding mismatch", { | ||
expect_error(test_file("latin1.R", "stop", encoding = "UTF-8")) | ||
expect_error(test_file("latin1.R", "stop", encoding = "UTF-8", wrap = FALSE)) | ||
}) | ||
|
||
test_that("error with UTF-8 encoding mismatch", { | ||
expect_error(test_file("utf8.R", "stop", encoding = "latin1")) | ||
expect_error(test_file("utf8.R", "stop", encoding = "latin1", wrap = FALSE)) | ||
}) |
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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
context("source_dir") | ||
|
||
test_that('source_dir()', { | ||
res <- source_dir('test_dir', pattern = 'hello', chdir = TRUE) | ||
res <- source_dir('test_dir', pattern = 'hello', chdir = TRUE, wrap = FALSE) | ||
expect_equal(res[[1]](), "Hello World") | ||
|
||
res <- source_dir(normalizePath('test_dir'), pattern = 'hello', chdir = TRUE) | ||
|
||
res <- source_dir(normalizePath('test_dir'), pattern = 'hello', chdir = TRUE, wrap = FALSE) | ||
expect_equal(res[[1]](), "Hello World") | ||
|
||
res <- source_dir('test_dir', pattern = 'hello', chdir = FALSE, wrap = FALSE) | ||
expect_equal(res[[1]](), "Hello World") | ||
|
||
res <- source_dir('test_dir', pattern = 'hello', chdir = FALSE) | ||
expect_equal(res[[1]](), "Hello World") | ||
|
||
res <- source_dir(normalizePath('test_dir'), pattern = 'hello', chdir = FALSE) | ||
res <- source_dir(normalizePath('test_dir'), pattern = 'hello', chdir = FALSE, wrap = FALSE) | ||
expect_equal(res[[1]](), "Hello World") | ||
}) |