-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from RMI-PACTA/test/fix-broken-r-checks
Test/fix broken r checks
- Loading branch information
Showing
49 changed files
with
724 additions
and
658 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 +1,6 @@ | ||
.dockerignore | ||
.github/ | ||
.lintr | ||
^LICENSE\.md$ | ||
Dockerfile | ||
docker-compose.yml |
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,4 @@ | ||
linters: all_linters() | ||
exclusions: list( | ||
"tests/testthat.R" | ||
) |
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,4 +1,5 @@ | ||
# Generated by roxygen2: do not edit by hand | ||
|
||
export(export_portfolio) | ||
export(process_directory) | ||
export(reexport_portfolio) |
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.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Empty file.
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,50 @@ | ||
# check for multiple conditions in a function's output. | ||
# matches by regexp as documented in expect_warning, etc. | ||
expect_multiple_conditions <- function( | ||
object, | ||
error = NULL, | ||
warning = NULL, | ||
message = NULL | ||
) { | ||
if (length(error) > 0L) { | ||
testthat::expect_error( | ||
object = { | ||
expect_multiple_conditions( | ||
object = object, | ||
message = message, | ||
warning = warning, | ||
error = error[-1L] | ||
) | ||
}, | ||
regexp = error[[1L]] | ||
) | ||
return(invisible(NULL)) | ||
} else if (length(warning) > 0L) { | ||
testthat::expect_warning( | ||
object = { | ||
out <- expect_multiple_conditions( | ||
object = object, | ||
message = message, | ||
warning = warning[-1L], | ||
error = error | ||
) | ||
}, | ||
regexp = warning[[1L]] | ||
) | ||
} else if (length(message) > 0L) { | ||
testthat::expect_message( | ||
object = { | ||
out <- expect_multiple_conditions( | ||
object = object, | ||
message = message[-1L], | ||
warning = warning, | ||
error = error | ||
) | ||
}, | ||
regexp = message[[1L]] | ||
) | ||
} else { | ||
out <- {{ object }} | ||
} | ||
return(invisible(out)) | ||
} |
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,32 @@ | ||
# Utility functions | ||
change_colnames <- function(x, colnames) { | ||
colnames(x) <- colnames | ||
return(x) | ||
} | ||
|
||
# Groups | ||
empty_groups <- data.frame() | ||
|
||
simple_groups <- tibble::tribble( | ||
~investor_name, ~portfolio_name, | ||
"Simple Investor", "Simple Portfolio" | ||
) | ||
|
||
# Portfolios | ||
simple_portfolio <- tibble::tribble( | ||
~isin, ~market_value, ~currency, | ||
"GB0007980591", 10000L, "USD" | ||
) | ||
|
||
simple_portfolio_all_columns <- dplyr::select( | ||
.data = dplyr::mutate( | ||
.data = simple_portfolio, | ||
portfolio_name = "Simple Portfolio", | ||
investor_name = "Simple Investor" | ||
), | ||
investor_name, | ||
portfolio_name, | ||
isin, | ||
market_value, | ||
currency | ||
) |
Oops, something went wrong.