feat: add desktop document search and verified native CPU embeddings
Core CI / core (ubuntu-latest) (push) Failing after 1m22s
Core CI / core (macos-latest) (push) Canceled after 0s
Core CI / core (windows-latest) (push) Canceled after 0s
Core CI / desktop (ubuntu-latest) (push) Successful in 3m46s
Core CI / desktop (macos-latest) (push) Canceled after 0s
Core CI / desktop (windows-latest) (push) Canceled after 0s
Core CI / core (ubuntu-latest) (push) Failing after 1m22s
Core CI / core (macos-latest) (push) Canceled after 0s
Core CI / core (windows-latest) (push) Canceled after 0s
Core CI / desktop (ubuntu-latest) (push) Successful in 3m46s
Core CI / desktop (macos-latest) (push) Canceled after 0s
Core CI / desktop (windows-latest) (push) Canceled after 0s
This commit is contained in:
1 parent
f77112db97
commit
a9b6592330
46 files changed
+10794
-77
No files matched your search
@@ -88,3 +88,42 @@ fn errors_are_nonzero_and_missing_database_is_not_created() {
|
||||
assert!(!bad_root.status.success());
|
||||
assert!(String::from_utf8_lossy(&bad_root.stderr).contains("missing-folder"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn exclusions_and_filters_change_real_results() {
|
||||
let fixture = Fixture::new();
|
||||
fs::create_dir_all(fixture.0.join("documents/private")).unwrap();
|
||||
fs::write(fixture.0.join("documents/report.txt"), "quarterly invoice").unwrap();
|
||||
fs::write(fixture.0.join("documents/report.md"), "quarterly invoice").unwrap();
|
||||
fs::write(fixture.0.join("documents/private/secret.txt"), "invoice").unwrap();
|
||||
let indexed = fixture.run(&[
|
||||
"index",
|
||||
"--db",
|
||||
"index.db",
|
||||
"--root",
|
||||
"documents",
|
||||
"--exclude",
|
||||
"private",
|
||||
]);
|
||||
assert!(indexed.status.success());
|
||||
let searched = fixture.run(&[
|
||||
"search",
|
||||
"--db",
|
||||
"index.db",
|
||||
"invoice",
|
||||
"--extension",
|
||||
"md",
|
||||
"--json",
|
||||
]);
|
||||
assert!(
|
||||
searched.status.success(),
|
||||
"{}",
|
||||
String::from_utf8_lossy(&searched.stderr)
|
||||
);
|
||||
let results: serde_json::Value = serde_json::from_slice(&searched.stdout).unwrap();
|
||||
assert_eq!(results.as_array().unwrap().len(), 1);
|
||||
assert_eq!(results[0]["filename"], "report.md");
|
||||
let stats = fixture.run(&["stats", "--db", "index.db", "--json"]);
|
||||
let stats: serde_json::Value = serde_json::from_slice(&stats.stdout).unwrap();
|
||||
assert_eq!(stats["files"], 2);
|
||||
}
|
||||
Reference in new issue
Block a user