# This file is auto-generated by alef — DO NOT EDIT.
# alef:hash:4e15143f4af1ae8bafbdb1506ef057da924484c66a19483966333558ad437e75
# To regenerate: alef generate
# To verify freshness: alef verify --exit-code
# Issues & docs: https://github.com/kreuzberg-dev/alef
# E2e tests for category: mime_utilities

test_that("mime_detect_bytes: Detect MIME type from file bytes", {
  result <- detect_mime_type_from_bytes(content = readBin(.resolve_fixture("pdf/fake_memo.pdf"), what = "raw", n = file.info(.resolve_fixture("pdf/fake_memo.pdf"))$size))
  expect_true(grepl("pdf", result, fixed = TRUE))
})

test_that("mime_detect_image: Detect MIME type from PNG image bytes", {
  result <- detect_mime_type_from_bytes(content = readBin(.resolve_fixture("images/test_hello_world.png"), what = "raw", n = file.info(.resolve_fixture("images/test_hello_world.png"))$size))
  expect_true(grepl("png", result, fixed = TRUE))
})

test_that("mime_get_extensions: Get file extensions for a MIME type", {
  result <- get_extensions_for_mime(mime_type = "application/pdf")
  expect_true(grepl("pdf", result, fixed = TRUE))
})
