tests/testthat/test-format.R

test_that("guessVideoFormat can correctly guess the correct format for common player extensions", {
  testthat::expect_identical(guessVideoFormat("video.mp4"), "video/mp4")
  testthat::expect_identical(guessVideoFormat("video.3gp"), "video/3gpp")
  testthat::expect_identical(guessVideoFormat("video.mpeg"), "video/mpeg")
  testthat::expect_identical(guessVideoFormat("video.ogg"), "video/ogg")
  testthat::expect_identical(guessVideoFormat("video.webm"), "video/webm")
})

test_that("guessVideoFormat returns message on non-video file", {
  testthat::expect_message({
    miss_file <- guessVideoFormat("video.docx")
  })
  testthat::expect_identical(miss_file, NA_character_)
})

Try the video package in your browser

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

video documentation built on Feb. 16, 2023, 6:52 p.m.