Skip to content

Commit

Permalink
tests: adapt tests (new column)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahasverus committed Dec 12, 2023
1 parent c15021a commit 0d17546
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/testthat/test-address_to_coords.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,19 @@ test_that("Function address_to_coords() - Test for success", {

expect_equal(class(x), "data.frame")
expect_equal(nrow(x), 1L)
expect_equal(ncol(x), 2L)
expect_equal(ncol(x), 3L)

expect_true(colnames(x)[1] == "lon")
expect_true(colnames(x)[2] == "lat")
expect_true(colnames(x)[3] == "name")

expect_equal(class(x[ , 1]), "numeric")
expect_equal(class(x[ , 2]), "numeric")
expect_equal(class(x[ , 3]), "character")

expect_equal(x[1, "lon"], -95.3677, tolerance = 0.0001)
expect_equal(x[1, "lat"], 29.75894, tolerance = 0.0001)
expect_equal(x[1, "name"], "Houston, Harris County, Texas, United States")


## Bad address ----
Expand All @@ -54,11 +57,13 @@ test_that("Function address_to_coords() - Test for success", {

expect_equal(class(x), "data.frame")
expect_equal(nrow(x), 0L)
expect_equal(ncol(x), 2L)
expect_equal(ncol(x), 3L)

expect_true(colnames(x)[1] == "lon")
expect_true(colnames(x)[2] == "lat")
expect_true(colnames(x)[3] == "name")

expect_equal(class(x[ , 1]), "numeric")
expect_equal(class(x[ , 2]), "numeric")
expect_equal(class(x[ , 3]), "character")
})

0 comments on commit 0d17546

Please sign in to comment.