Add #[track_caller] to test utilities that involve marked text (#32043)

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-06-03 20:37:27 -06:00 committed by GitHub
parent 030d4d2631
commit 48eacf3f2a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 12 additions and 0 deletions

View file

@ -109,6 +109,7 @@ pub fn marked_text_ranges_by(
/// Any • characters in the input string will be replaced with spaces. This makes
/// it easier to test cases with trailing spaces, which tend to get trimmed from the
/// source code.
#[track_caller]
pub fn marked_text_ranges(
marked_text: &str,
ranges_are_directed: bool,
@ -176,6 +177,7 @@ pub fn marked_text_ranges(
(unmarked_text, ranges)
}
#[track_caller]
pub fn marked_text_offsets(marked_text: &str) -> (String, Vec<usize>) {
let (text, ranges) = marked_text_ranges(marked_text, false);
(