-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow whitespace after code headers in
split_code_headers()
(#678)
Co-authored-by: Garrick Aden-Buie <[email protected]>
- Loading branch information
1 parent
6339fa0
commit 1c01ac2
Showing
3 changed files
with
44 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
test_that("split_code_headers()", { | ||
target <- list(one = "1", two = "2") | ||
|
||
# No whitespace after dashes | ||
expect_equal( | ||
split_code_headers( | ||
"# one ---- | ||
1 | ||
# two ---- | ||
2" | ||
), | ||
target | ||
) | ||
|
||
|
||
# Whitespace after first header | ||
expect_equal( | ||
split_code_headers( | ||
"# one ---- | ||
1 | ||
# two ---- | ||
2" | ||
), | ||
target | ||
) | ||
|
||
# Whitespace after subsequent headers | ||
expect_equal( | ||
split_code_headers( | ||
"# one ---- | ||
1 | ||
# two ---- | ||
2" | ||
), | ||
target | ||
) | ||
}) |