Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
UMR-ASTRE
mapMCDA
Commits
826f6019
Commit
826f6019
authored
Oct 22, 2021
by
Facundo Muñoz
®️
Browse files
Bugfix in tests: fix warnings due to open connections.
parent
a165d465
Changes
3
Hide whitespace changes
Inline
Side-by-side
DESCRIPTION
View file @
826f6019
Package: mapMCDA
Title: Produce an epidemiological risk map by weighting multiple risk
factors
Version: 0.4.5
5
Date: 2021-0
5
-2
8
Version: 0.4.5
6
Date: 2021-
1
0-2
2
Authors@R: c( person("Andrea", "Apolloni", email =
"andrea.apolloni@cirad.fr", role = c("ctb"), comment = "Animal
mobility algorithm"), person("Elena", "Arsevska", email =
...
...
tests/testthat/test-csv_sep.R
View file @
826f6019
...
...
@@ -12,30 +12,24 @@ test_that("Detects various separators correctly", {
expect_identical
(
csv_sep
(
tf
),
","
)
## Separate with ";" and decimal comma
writeLines
(
gsub
(
","
,
";"
,
readLines
(
tf
)),
file
(
tf2
)
)
writeLines
(
gsub
(
"\\."
,
","
,
readLines
(
tf2
)),
file
(
tf2
)
)
writeLines
(
gsub
(
","
,
";"
,
readLines
(
tf
)),
tf2
)
writeLines
(
gsub
(
"\\."
,
","
,
readLines
(
tf2
)),
tf2
)
expect_identical
(
csv_sep
(
tf2
),
";"
)
close
(
file
(
tf2
))
## Separate with ":"
writeLines
(
gsub
(
","
,
":"
,
readLines
(
tf
)),
file
(
tf2
)
)
writeLines
(
gsub
(
","
,
":"
,
readLines
(
tf
)),
tf2
)
expect_identical
(
csv_sep
(
tf2
),
":"
)
close
(
file
(
tf2
))
## Separate with " "
writeLines
(
gsub
(
","
,
" "
,
readLines
(
tf
)),
file
(
tf2
)
)
writeLines
(
gsub
(
","
,
" "
,
readLines
(
tf
)),
tf2
)
expect_identical
(
csv_sep
(
tf2
),
" "
)
close
(
file
(
tf2
))
## Separate with tab
writeLines
(
gsub
(
","
,
"\t"
,
readLines
(
tf
)),
file
(
tf2
)
)
writeLines
(
gsub
(
","
,
"\t"
,
readLines
(
tf
)),
tf2
)
expect_identical
(
csv_sep
(
tf2
),
"\t"
)
close
(
file
(
tf2
))
## Separate with "|"
writeLines
(
gsub
(
","
,
"|"
,
readLines
(
tf
)),
file
(
tf2
)
)
writeLines
(
gsub
(
","
,
"|"
,
readLines
(
tf
)),
tf2
)
expect_identical
(
csv_sep
(
tf2
),
"|"
)
close
(
file
(
tf2
))
close
(
file
(
tf
))
})
tests/testthat/test-load.R
View file @
826f6019
...
...
@@ -70,15 +70,13 @@ test_that("Interpret network data", {
## Test data with ";" field separator and "," decimal separator
tf2
<-
tempfile
()
writeLines
(
gsub
(
","
,
";"
,
readLines
(
tf
)),
file
(
tf2
)
)
writeLines
(
gsub
(
"\\."
,
","
,
readLines
(
tf2
)),
file
(
tf2
)
)
writeLines
(
gsub
(
","
,
";"
,
readLines
(
tf
)),
tf2
)
writeLines
(
gsub
(
"\\."
,
","
,
readLines
(
tf2
)),
tf2
)
n2
<-
expect_error
(
suppressWarnings
(
read_network
(
tf2
)),
NA
)
expect_s3_class
(
n2
,
"igraph"
)
# all.equal(n1, n2)
close
(
file
(
tf
))
close
(
file
(
tf2
))
})
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment