tests/testthat/test-map.R

context("map.R")

test_that("geocode() for a single address", {
  address <- "285 Fulton St, New York"
  expect_equal(data.frame(lat=40.713008, lng=-74.013169), geocode(address))
})

test_that("geocode() for multiple addresses", {
  address <- c("東京都中央区月島2-10-1", "東京都江東区豊洲3-6-8")
  answer <- data.frame(lat=c(35.66357, 35.65986), lng=c(139.7844, 139.7962))
  expect_equal(answer, geocode(address),tolerance = .0001)
})
teramonagi/gigamonagi documentation built on May 31, 2019, 8:37 a.m.