Line termination change and old code.

This commit is contained in:
2021-11-16 00:31:48 -05:00
parent b1e00f52f7
commit affe00f6fb
86 changed files with 37873 additions and 37876 deletions

View File

@@ -1,32 +1,32 @@
# test_biCode.R
#
context("biCode() utility function tests") # A set of tests for some
# functionality
test_that("expected input is processed correctly", { # Related expectations
expect_equal(biCode("homo sapiens"), "HOMSA")
expect_equal(biCode("[homo sapiens neanderthaliensis]"), "HOMSA")
expect_equal(biCode(c("Phascolarctos cinereus", "Macropus rufus")),
c("PHACI", "MACRU"))
})
test_that("unexpected input is managed", {
expect_equal(biCode(""), ".....")
expect_equal(biCode(" "), ".....")
expect_equal(biCode("123 12"), ".....")
expect_equal(biCode("h sapiens"), "H..SA")
})
test_that("NA values are preserved", {
expect_true(is.na((biCode(NA))))
expect_equal(biCode(c("first", NA, "last")),
c("FIRST", NA, "LAST."))
})
test_that("Missing argument throws an error", {
expect_error(biCode(), "argument \"s\" is missing, with no default")
})
# [END]
# test_biCode.R
#
context("biCode() utility function tests") # A set of tests for some
# functionality
test_that("expected input is processed correctly", { # Related expectations
expect_equal(biCode("homo sapiens"), "HOMSA")
expect_equal(biCode("[homo sapiens neanderthaliensis]"), "HOMSA")
expect_equal(biCode(c("Phascolarctos cinereus", "Macropus rufus")),
c("PHACI", "MACRU"))
})
test_that("unexpected input is managed", {
expect_equal(biCode(""), ".....")
expect_equal(biCode(" "), ".....")
expect_equal(biCode("123 12"), ".....")
expect_equal(biCode("h sapiens"), "H..SA")
})
test_that("NA values are preserved", {
expect_true(is.na((biCode(NA))))
expect_equal(biCode(c("first", NA, "last")),
c("FIRST", NA, "LAST."))
})
test_that("Missing argument throws an error", {
expect_error(biCode(), "argument \"s\" is missing, with no default")
})
# [END]