Nomad changes
All checks were successful
Deploy fil (kreuzberg) / deploy (push) Successful in 49s

This commit is contained in:
Henrik Jess Nielsen
2026-06-01 23:40:55 +02:00
parent 72b1a0a6ed
commit b4c07d3693
5723 changed files with 1130655 additions and 0 deletions

27
e2e/r/tests/test_error.R generated Normal file
View File

@@ -0,0 +1,27 @@
# 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: error
test_that("error_empty_bytes: Graceful handling of empty bytes (should not error)", {
result <- jsonlite::fromJSON(extract_bytes_sync(content = readBin(.resolve_fixture("text/empty.txt"), what = "raw", n = file.info(.resolve_fixture("text/empty.txt"))$size), mime_type = "text/plain", config = ExtractionConfig$default()), simplifyVector = FALSE)
expect_true(TRUE)
})
test_that("error_empty_mime: Error when extracting with empty MIME type", {
expect_error(extract_bytes_sync(content = readBin(.resolve_fixture("text/plain.txt"), what = "raw", n = file.info(.resolve_fixture("text/plain.txt"))$size), mime_type = "", config = ExtractionConfig$default()))
})
test_that("error_extract_bytes_conflicting_ocr: extract_bytes force+disable OCR", {
expect_error(extract_bytes_sync(content = readBin(.resolve_fixture("text/fake_text.txt"), what = "raw", n = file.info(.resolve_fixture("text/fake_text.txt"))$size), mime_type = "text/plain", config = ExtractionConfig$from_json(jsonlite::toJSON(list("disable_ocr" = TRUE, "force_ocr" = TRUE), auto_unbox = TRUE))))
})
test_that("error_invalid_mime_format: Error when extracting with invalid MIME type format", {
expect_error(extract_bytes_sync(content = readBin(.resolve_fixture("text/plain.txt"), what = "raw", n = file.info(.resolve_fixture("text/plain.txt"))$size), mime_type = "not-a-mime", config = ExtractionConfig$default()))
})
test_that("error_unsupported_mime: Error when extracting with unsupported MIME type", {
expect_error(extract_bytes_sync(content = readBin(.resolve_fixture("text/plain.txt"), what = "raw", n = file.info(.resolve_fixture("text/plain.txt"))$size), mime_type = "application/x-nonexistent", config = ExtractionConfig$default()))
})