From b748e2406209312147f6e66e1d7cc2b00ac1cc09 Mon Sep 17 00:00:00 2001 From: James Riley Date: Mon, 2 Dec 2024 13:58:20 +0000 Subject: [PATCH] stem_words.r tested --- tests/testthat/test-stem_words.R | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/testthat/test-stem_words.R diff --git a/tests/testthat/test-stem_words.R b/tests/testthat/test-stem_words.R new file mode 100644 index 0000000..95d3205 --- /dev/null +++ b/tests/testthat/test-stem_words.R @@ -0,0 +1,13 @@ +test_that("stemming works", { + x <- c("win", "winning", "winner", NA) + + # test with no exceptions + + expect_equal(stem_words(x), c("win", "win", "winner", NA)) + + # test with single exception + expect_equal( + stem_words(x, exceptions = "winning"), + c("win", "winning", "winner", NA) + ) +})