tests/testthat/test_cleanEmails.R

library(data.cleaning.HU)
context("cleanEmails")

test_that("hosszok_egyeznek",{
  expect_equal(length(cleanEmails(character(0))),
               0)
  expect_equal(length(cleanEmails("[email protected]")),
               1)
  expect_equal(length(cleanEmails(c("[email protected]",
                                    "[email protected]"))),
               2)
  })

test_that("NA-k a hely\u00FCk\u00F6n vannak", {
  expect_equal(which(is.na(cleanEmails(NA))),
               1)
  expect_equal(which(is.na(cleanEmails(c("[email protected]",
                                         NA)))),
               2)
  expect_equal(which(is.na(cleanEmails(c(NA,
                                        "[email protected]",
                                         NA)))),
               c(1, 3))
  })

test_that("m\u0171k\u00F6dik a p\u00E9lda", {
  expect_equal(cleanEmails("[email protected]"),
               "[email protected]")
  })
atajti/andego.adattisztitas documentation built on Nov. 21, 2018, 5:43 a.m.