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

Release Notes:

- N/A
This commit is contained in:
Michael Sloan
2025-06-04 02:37:27 +00:00
committed by GitHub
parent 030d4d2631
commit 48eacf3f2a
7 changed files with 12 additions and 0 deletions
+2
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);
(