tests/testthat/test-long-lang.R

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

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

test_that("long.lang", {
  skip_on_cran()
    expect_equal(long.lang("Adyghe"), c(Adyghe = 39.33))
    expect_equal(long.lang(c("Adyghe", "Russian")), c(Adyghe = 39.33, Russian = 50))
    expect_equal(long.lang(df), c(my_langs1 = 39.33, my_langs2 = 50))
    expect_equal(round(long.lang("Aleut"), 4), c(Aleut = 185.71))
    expect_equal(round(long.lang("Aleut", map.orientation = "Atlantic"), 2), c(Aleut = -174.29))
})

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.