// 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: plugin_api

use kreuzberg::{
    register_document_extractor, register_embedding_backend, register_ocr_backend, register_post_processor,
    register_renderer, register_validator, unregister_document_extractor, unregister_embedding_backend,
    unregister_post_processor, unregister_renderer, unregister_validator,
};

#[test]
fn test_register_document_extractor_trait_bridge() {
    // register_document_extractor: trait bridge
    #[allow(unused_imports)]
    use kreuzberg::DocumentExtractor;
    #[allow(unused_imports)]
    use kreuzberg::ExtractionConfig;
    #[allow(unused_imports)]
    use kreuzberg::InternalDocument;
    struct TestStubRegisterDocumentExtractorTraitBridge {
        _name: &'static str,
    }
    impl kreuzberg::plugins::Plugin for TestStubRegisterDocumentExtractorTraitBridge {
        fn name(&self) -> &str {
            self._name
        }
    }
    #[async_trait::async_trait]
    impl DocumentExtractor for TestStubRegisterDocumentExtractorTraitBridge {
        async fn extract_bytes(
            &self,
            _p0: &[u8],
            _p1: &str,
            _p2: &ExtractionConfig,
        ) -> kreuzberg::Result<InternalDocument> {
            Ok(InternalDocument::default())
        }
        fn supported_mime_types(&self) -> &[&str] {
            &[]
        }
    }
    let _ = register_document_extractor(std::sync::Arc::new(TestStubRegisterDocumentExtractorTraitBridge {
        _name: "test-extractor",
    }));
}

#[test]
fn test_register_embedding_backend_trait_bridge() {
    // register_embedding_backend: trait bridge
    #[allow(unused_imports)]
    use kreuzberg::EmbeddingBackend;
    struct TestStubRegisterEmbeddingBackendTraitBridge {
        _name: &'static str,
    }
    impl kreuzberg::plugins::Plugin for TestStubRegisterEmbeddingBackendTraitBridge {
        fn name(&self) -> &str {
            self._name
        }
    }
    #[async_trait::async_trait]
    impl EmbeddingBackend for TestStubRegisterEmbeddingBackendTraitBridge {
        fn dimensions(&self) -> usize {
            0
        }
        async fn embed(&self, _p0: Vec<String>) -> kreuzberg::Result<Vec<Vec<f32>>> {
            Ok(Vec::new())
        }
    }
    let _ = register_embedding_backend(std::sync::Arc::new(TestStubRegisterEmbeddingBackendTraitBridge {
        _name: "test-embedding-backend",
    }));
}

#[test]
fn test_register_ocr_backend_trait_bridge() {
    // register_ocr_backend: trait bridge
    #[allow(unused_imports)]
    use kreuzberg::ExtractionResult;
    #[allow(unused_imports)]
    use kreuzberg::OcrBackend;
    #[allow(unused_imports)]
    use kreuzberg::OcrBackendType;
    #[allow(unused_imports)]
    use kreuzberg::OcrConfig;
    struct TestStubRegisterOcrBackendTraitBridge {
        _name: &'static str,
    }
    impl kreuzberg::plugins::Plugin for TestStubRegisterOcrBackendTraitBridge {
        fn name(&self) -> &str {
            self._name
        }
    }
    #[async_trait::async_trait]
    impl OcrBackend for TestStubRegisterOcrBackendTraitBridge {
        async fn process_image(&self, _p0: &[u8], _p1: &OcrConfig) -> kreuzberg::Result<ExtractionResult> {
            Ok(ExtractionResult::default())
        }
        fn supports_language(&self, _p0: &str) -> bool {
            false
        }
        fn backend_type(&self) -> OcrBackendType {
            OcrBackendType::default()
        }
    }
    let _ = register_ocr_backend(std::sync::Arc::new(TestStubRegisterOcrBackendTraitBridge {
        _name: "test-backend",
    }));
}

#[test]
fn test_register_post_processor_trait_bridge() {
    // register_post_processor: trait bridge
    #[allow(unused_imports)]
    use kreuzberg::ExtractionConfig;
    #[allow(unused_imports)]
    use kreuzberg::ExtractionResult;
    #[allow(unused_imports)]
    use kreuzberg::PostProcessor;
    #[allow(unused_imports)]
    use kreuzberg::ProcessingStage;
    struct TestStubRegisterPostProcessorTraitBridge {
        _name: &'static str,
    }
    impl kreuzberg::plugins::Plugin for TestStubRegisterPostProcessorTraitBridge {
        fn name(&self) -> &str {
            self._name
        }
    }
    #[async_trait::async_trait]
    impl PostProcessor for TestStubRegisterPostProcessorTraitBridge {
        async fn process(&self, _p0: &mut ExtractionResult, _p1: &ExtractionConfig) -> kreuzberg::Result<()> {
            Ok(())
        }
        fn processing_stage(&self) -> ProcessingStage {
            ProcessingStage::default()
        }
    }
    let _ = register_post_processor(std::sync::Arc::new(TestStubRegisterPostProcessorTraitBridge {
        _name: "test-processor",
    }));
}

#[test]
fn test_register_renderer_trait_bridge() {
    // register_renderer: trait bridge
    #[allow(unused_imports)]
    use kreuzberg::InternalDocument;
    #[allow(unused_imports)]
    use kreuzberg::Renderer;
    struct TestStubRegisterRendererTraitBridge {
        _name: &'static str,
    }
    impl kreuzberg::plugins::Plugin for TestStubRegisterRendererTraitBridge {
        fn name(&self) -> &str {
            self._name
        }
    }
    impl Renderer for TestStubRegisterRendererTraitBridge {
        fn render(&self, _p0: &InternalDocument) -> kreuzberg::Result<String> {
            Ok(String::new())
        }
    }
    let _ = register_renderer(std::sync::Arc::new(TestStubRegisterRendererTraitBridge {
        _name: "test-renderer",
    }));
}

#[test]
fn test_register_validator_trait_bridge() {
    // register_validator: trait bridge
    #[allow(unused_imports)]
    use kreuzberg::ExtractionConfig;
    #[allow(unused_imports)]
    use kreuzberg::ExtractionResult;
    #[allow(unused_imports)]
    use kreuzberg::Validator;
    struct TestStubRegisterValidatorTraitBridge {
        _name: &'static str,
    }
    impl kreuzberg::plugins::Plugin for TestStubRegisterValidatorTraitBridge {
        fn name(&self) -> &str {
            self._name
        }
    }
    #[async_trait::async_trait]
    impl Validator for TestStubRegisterValidatorTraitBridge {
        async fn validate(&self, _p0: &ExtractionResult, _p1: &ExtractionConfig) -> kreuzberg::Result<()> {
            Ok(())
        }
    }
    let _ = register_validator(std::sync::Arc::new(TestStubRegisterValidatorTraitBridge {
        _name: "test-validator",
    }));
}

#[test]
fn test_unregister_document_extractor_after_register() {
    // unregister_document_extractor
    let name = r#"test-extractor"#;
    let _ = unregister_document_extractor(name);
}

#[test]
fn test_unregister_embedding_backend_after_register() {
    // unregister_embedding_backend
    let name = r#"test-embedding-backend"#;
    let _ = unregister_embedding_backend(name);
}

#[test]
fn test_unregister_post_processor_after_register() {
    // unregister_post_processor
    let name = r#"test-processor"#;
    let _ = unregister_post_processor(name);
}

#[test]
fn test_unregister_renderer_after_register() {
    // unregister_renderer
    let name = r#"test-renderer"#;
    let _ = unregister_renderer(name);
}

#[test]
fn test_unregister_validator_after_register() {
    // unregister_validator
    let name = r#"test-validator"#;
    let _ = unregister_validator(name);
}
