Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit 08ac540

Browse files
author
Hendrik van Antwerpen
committed
Leave path computation for tests to the caller
1 parent 3105ed6 commit 08ac540

File tree

1 file changed

+2
-15
lines changed
  • tree-sitter-stack-graphs/src

1 file changed

+2
-15
lines changed

tree-sitter-stack-graphs/src/test.rs

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -617,27 +617,14 @@ impl std::fmt::Display for TestFailure {
617617

618618
impl Test {
619619
/// Run the test. It is the responsibility of the caller to ensure that
620-
/// the stack graph has been constructed for the test fragments before running
621-
/// the test.
620+
/// the stack graph for the test fragments has been constructed, and the
621+
/// database has been filled with partial paths before running the test.
622622
pub fn run(
623623
&mut self,
624624
partials: &mut PartialPaths,
625625
db: &mut Database,
626626
cancellation_flag: &dyn CancellationFlag,
627627
) -> Result<TestResult, stack_graphs::CancellationError> {
628-
// build partial paths
629-
for file in self.graph.iter_files() {
630-
partials.find_minimal_partial_path_set_in_file(
631-
&self.graph,
632-
file,
633-
&cancellation_flag,
634-
|g, ps, p| {
635-
db.add_partial_path(g, ps, p);
636-
},
637-
)?;
638-
}
639-
640-
// test assertions
641628
let mut result = TestResult::new();
642629
for fragment in &self.fragments {
643630
for assertion in &fragment.assertions {

0 commit comments

Comments
 (0)