tests/testthat/test_read_vcf.r

v <- system.file("extdata", "test.vcf.gz", package = "valr")
x <- read_vcf(v)

test_that("colnames are set in vcf df", {
  expect_true("chrom" %in% colnames(x))
  expect_true("start" %in% colnames(x))
  expect_true("end" %in% colnames(x))
})

test_that("chrom names are set correctly", {
  expect_true(all(stringr::str_detect(x$chrom, "^chr")))
})

Try the valr package in your browser

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

valr documentation built on Sept. 19, 2023, 1:07 a.m.