yazi/yazi-shared/src/tests.rs
三咲雅 misaki masa 1f85b1a2bf
feat: new hub VFS kind
2026-07-17 02:30:46 +08:00

21 lines
642 B
Rust

use std::sync::OnceLock;
use crate::auth::{Auth, AuthInventory, AuthKind};
pub fn init_tests() {
static INIT: OnceLock<()> = OnceLock::new();
INIT.get_or_init(crate::init);
}
inventory::submit! {
AuthInventory {
get: |scheme, domain| match (scheme.as_str(), domain.as_ref()) {
("test-mount", "7z") => Some(Auth::new(AuthKind::Mount, scheme.clone(), "7z")),
("test-hub", _) => Some(Auth::new(AuthKind::Hub, scheme.clone(), domain.clone())),
("test-scope", "aws") => Some(Auth::new(AuthKind::Scope, scheme.clone(), "aws")),
("sftp", "vps") => Some(Auth::new(AuthKind::Sftp, scheme.clone(), "vps")),
_ => None,
},
}
}