tests/testthat/test-lang-iso.R

library(lingtypology)
context("Tests for lang.iso function")

df <- data.frame(my_langs = c("ady", "rus"), stringsAsFactors = FALSE)

test_that("lang.iso", {
  skip_on_cran()
    expect_equal(lang.iso("ady"), c(ady = "Adyghe"))
    expect_equal(lang.iso(df), c(my_langs1 = "Adyghe", my_langs2 = "Russian"))
    expect_equal(lang.iso(c("ady", "rus")), c(ady = "Adyghe", rus = "Russian"))
})

Try the lingtypology package in your browser

Any scripts or data that you put into this service are public.

lingtypology documentation built on Aug. 23, 2023, 5:09 p.m.