Commit 826f6019 authored by Facundo Muñoz's avatar Facundo Muñoz ®️
Browse files

Bugfix in tests: fix warnings due to open connections.

parent a165d465
Package: mapMCDA
Title: Produce an epidemiological risk map by weighting multiple risk
factors
Version: 0.4.55
Date: 2021-05-28
Version: 0.4.56
Date: 2021-10-22
Authors@R: c( person("Andrea", "Apolloni", email =
"andrea.apolloni@cirad.fr", role = c("ctb"), comment = "Animal
mobility algorithm"), person("Elena", "Arsevska", email =
......
......@@ -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))
})
......@@ -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))
})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment