tests/testthat/test_fuzzy_block.R

context("Test fuzzy blocking")

# need to load data.
# need to test errors if things missing
# need to test output
# need to test input/output var names?

library(postalcodes)
postal_input <- postalcodes::postal_coords[1:5, 'postalcode'][[1]]
bl <- fuzzy_block(postal_input = postal_input, postal_coords = postal_coords)
#so this can't be a one col tbl, or anything else. fix that later.

test_that("Test that fuzzy_block() returns a tbl_df with two postalcode columns", {
  expect_output(str(bl), "tbl_df")
  expect_output(str(bl), "postalcode.x", fixed = TRUE)
  expect_output(str(bl), "postalcode.y", fixed = TRUE)
})
tweed1e/matchtools documentation built on May 29, 2019, 10:51 a.m.