#[cfg(test)]
mod tests {
    use crate::meta_plugin::MetaPlugin;
    use crate::meta_plugin::infer_plugin::InferMetaPlugin;

    #[test]
    fn test_infer_meta_plugin() {
        let plugin = InferMetaPlugin::new(None, None);

        assert_eq!(
            plugin.meta_type(),
            crate::meta_plugin::MetaPluginType::Infer
        );
        assert!(plugin.is_internal());
    }

    #[test]
    fn test_infer_png_detection() {
        let png_header: &[u8] = &[
            0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A, 0x00, 0x00, 0x00, 0x0D, 0x49, 0x48,
            0x44, 0x52, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x08, 0x02, 0x00, 0x00,
            0x00, 0x90, 0x77, 0x53, 0xDE,
        ];
        let mut plugin = InferMetaPlugin::new(None, None);
        plugin.update(png_header);
        let response = plugin.finalize();

        assert!(response.is_finalized);
        assert!(!response.metadata.is_empty());
        assert_eq!(response.metadata[0].name, "infer_mime_type");
        assert_eq!(response.metadata[0].value, "image/png");
    }
}
