tests/testthat/test_cleanEmails.R

library(andego.adattisztitas)
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ükön 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űködik a példa", {
  expect_equal(cleanEmails("[email protected]"),
               "[email protected]")
  })
atajti/andego.adattisztitas documentation built on Dec. 30, 2017, 11:03 a.m.