Skip to content

Commit

Permalink
test that manipulateFile does not destroy comments. Needs lucode2#205
Browse files Browse the repository at this point in the history
  • Loading branch information
orichters committed Aug 5, 2024
1 parent b250c0a commit 71094c9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Imports:
knitr,
lazyeval,
lpjclass,
lucode2 (>= 0.47.8),
lucode2 (>= 0.47.9),
luplot,
luscale,
lusweave,
Expand Down
7 changes: 1 addition & 6 deletions tests/testthat/test_01-manipulateConfig.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ test_that("manipulate config with default configuration does not change main.gms
diffresult <- NULL
diffavailable <- ! Sys.which("diff") == ""
if (diffavailable) {
diffresult <- suppressWarnings(system(paste("diff -b ../../main.gms", tmpfile), intern = TRUE))
# drop all sorts of comments until https://github.com/pik-piam/lucode2/issues/121 is fixed
drop <- c("^< \\*\\*\\*", "^> \\*\\*\\*", "^> \\*' \\*", "^< \\*' \\*", "^---$", "^[0-9,]+c[0-9,]+$")
for (d in drop) {
diffresult <- grep(d, diffresult, value = TRUE, invert = TRUE)
}
diffresult <- suppressWarnings(system(paste("diff ../../main.gms", tmpfile), intern = TRUE))
if (length(diffresult) > 0) {
warning("Applying manipulateConfig with the default configuration leads to this diff between main.gms and ",
basename(tmpfile), ":\n",
Expand Down

0 comments on commit 71094c9

Please sign in to comment.