use crate::memory::local_engine::*;
#[test]
fn doc_template_is_stable() {
assert_eq!(
format_doc_for_embedding("hello world", Some("Test Title")),
"title: Test Title | text: hello world"
);
assert_eq!(
format_doc_for_embedding("hello world", None),
"title: none | text: hello world"
);
}
#[test]
fn query_template_is_stable() {
assert_eq!(
format_query_for_embedding("test query"),
"task: search result | query: test query"
);
}
#[test]
fn parse_hf_uri_shapes() {
let r = parse_hf_uri(DEFAULT_EMBED_MODEL_URI).unwrap();
assert_eq!(r.repo, "ggml-org/embeddinggemma-300M-GGUF");
assert_eq!(r.file, DEFAULT_EMBED_MODEL);
assert!(parse_hf_uri("not-a-uri").is_none());
assert!(parse_hf_uri("hf:only/two").is_none());
}
#[test]
fn cache_dir_is_qmds() {
let dir = model_cache_dir();
assert!(dir.ends_with("qmd/models"), "got {}", dir.display());
}