tests/testthat/test-url-lang.R

library(lingtypology)
context("Tests for makelink function")

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

test_that("makelink", {
  skip_on_cran()
    expect_equal(url.lang("Adyghe"), "<a href='https://glottolog.org/resource/languoid/id/adyg1241' target='_blank'>Adyghe</a><br>")
    expect_equal(url.lang(df), "<a href='https://glottolog.org/resource/languoid/id/adyg1241' target='_blank'>Adyghe</a><br>")
    expect_equal(url.lang("Hachijo"), "<a href='https://glottolog.org/resource/languoid/id/hach1239' target='_blank'>Hachijo</a><br>")
})

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.