test/testthat/test_close_names.R

#!/usr/bin/Rscript
# -*- coding: utf-8 -*-

################################ Description ###################################
# Title: Test unit for close_names
# Created the 2014-12-31 
# by Joris Muller <joris.muller@jom.link>
# Licence: GPLv3 <http://www.gnu.org/licenses/>
################################################################################

library(testthat)

library(stringdist)

char1 <- c("house", "House", "houses", "tree")

test_that("Find close strings", {
r <- find_close_strings(char1)
expect_is(r, "list")
expect_equal(r[[1]], c("House", "houses"))
}
jomuller/dfcheck documentation built on May 19, 2019, 7:26 p.m.