MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / fixture

Function fixture

atomic-repository/src/repository/tests/query_view_tests.rs:406–435  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

404}
405
406fn fixture() -> (TempDir, TestRepository, Hash) {
407 let (temp, mut repo) = create_temp_repo();
408 std::fs::create_dir_all(temp.path().join("src")).unwrap();
409 std::fs::write(
410 temp.path().join("src/lib.rs"),
411 "pub fn target() {}\npub fn caller() { target(); }\n// inherited_marker\n",
412 )
413 .unwrap();
414 repo.add("src/lib.rs", TrackingOptions::default()).unwrap();
415 record(&repo, "inherited history");
416 repo.kg_enrich_from_vcs(repo.working_copy()).unwrap();
417 repo.create_draft_view("feature", "dev").unwrap();
418 repo.switch_view("feature").unwrap();
419 std::fs::write(
420 temp.path().join("src/lib.rs"),
421 "pub fn target(secret: SiblingSecret) {}\npub fn caller() {}\n// inherited_marker\n",
422 )
423 .unwrap();
424 std::fs::write(
425 temp.path().join("src/sibling.rs"),
426 "pub fn sibling_only() { target(); }\n// sibling_marker\n",
427 )
428 .unwrap();
429 repo.add("src/sibling.rs", TrackingOptions::default())
430 .unwrap();
431 let feature = record(&repo, "sibling_history_marker");
432 repo.kg_enrich_from_vcs(repo.working_copy()).unwrap();
433 crate::build_content_index(temp.path()).unwrap();
434 (temp, repo, feature)
435}
436
437#[test]
438fn query_search_filters_before_ranking_and_uses_recorded_sources() {

Calls 11

create_temp_repoFunction · 0.85
build_content_indexFunction · 0.85
kg_enrich_from_vcsMethod · 0.80
create_draft_viewMethod · 0.80
recordFunction · 0.70
writeFunction · 0.50
unwrapMethod · 0.45
pathMethod · 0.45
addMethod · 0.45
working_copyMethod · 0.45
switch_viewMethod · 0.45

Tested by

no test coverage detected