Skip to content

Group class and module indexing tests into dedicated test module#664

Open
alexcrocha wants to merge 1 commit intomainfrom
03-13-extract_class_and_module_tests_from_monolithic_mod_tests
Open

Group class and module indexing tests into dedicated test module#664
alexcrocha wants to merge 1 commit intomainfrom
03-13-extract_class_and_module_tests_from_monolithic_mod_tests

Conversation

@alexcrocha
Copy link
Contributor

@alexcrocha alexcrocha commented Mar 14, 2026

This PR is the first in a stack that addresses #649.

By grouping class and module indexing tests into a dedicated test module, we improve discoverability for both editor navigation and code search by giving class/module definition tests a named boundary.

Follows the existing name_dependent_tests pattern.

Copy link
Contributor Author

alexcrocha commented Mar 14, 2026

@alexcrocha alexcrocha marked this pull request as ready for review March 14, 2026 03:17
@alexcrocha alexcrocha requested a review from a team as a code owner March 14, 2026 03:17
@alexcrocha alexcrocha self-assigned this Mar 14, 2026
@alexcrocha alexcrocha added the chore Something that should not be included in release notes label Mar 14, 2026
Comment on lines +5807 to +5814
use crate::{
assert_def_name_eq, assert_def_name_offset_eq, assert_definition_at, assert_local_diagnostics_eq,
assert_no_local_diagnostics, test_utils::LocalGraphTest,
};

fn index_source(source: &str) -> LocalGraphTest {
LocalGraphTest::new("file:///foo.rb", source)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it make sense to use nested modules so that all imports and shared helpers are at the top? It also avoids repeating the #cfg[(test)].

For example:

#[cfg(test)]
mod tests {
  use crate::...

  fn index_source(...) {}

  mod classes_and_modules {}

  mod methods {}

  mod instance_variables {}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. The argument for sibling modules is that they would be fully self contained and ready to be extracted out of this file when we make that call. But to be honest the effort to doing so is the same now or later.

We can go with sub-modules for now.

@alexcrocha alexcrocha force-pushed the 03-13-extract_class_and_module_tests_from_monolithic_mod_tests branch from 6992214 to 393ad5f Compare March 17, 2026 22:48
Improves discoverability for both editor navigation (document symbols)
and code search by giving class/module definition tests a named boundary
@alexcrocha alexcrocha force-pushed the 03-13-extract_class_and_module_tests_from_monolithic_mod_tests branch from 393ad5f to 6356a83 Compare March 17, 2026 23:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Something that should not be included in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants