Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
teunbrand committed Oct 7, 2024
1 parent aad1da2 commit e1d0e49
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/testthat/test-label-lut.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
test_that("label_lut gives correct answers", {

short <- c("A", "B", "C")
lut <- c("A" = "Apple", "C" = "Cherry", "D" = "Date")

expect_equal(label_lut(lut)(short), c("Apple", "B", "Cherry"))
expect_equal(
label_lut(lut, nomatch = "Banana")(short),
c("Apple", "Banana", "Cherry")
)
})

0 comments on commit e1d0e49

Please sign in to comment.