Group class and module indexing tests into dedicated test module#664
Open
alexcrocha wants to merge 1 commit intomainfrom
Open
Group class and module indexing tests into dedicated test module#664alexcrocha wants to merge 1 commit intomainfrom
alexcrocha wants to merge 1 commit intomainfrom
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
vinistock
reviewed
Mar 16, 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) | ||
| } |
Member
There was a problem hiding this comment.
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 {}
}
Contributor
Author
There was a problem hiding this comment.
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.
6992214 to
393ad5f
Compare
Improves discoverability for both editor navigation (document symbols) and code search by giving class/module definition tests a named boundary
393ad5f to
6356a83
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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_testspattern.