Skip to content

Commit a09bd23

Browse files
committed
Add a test for a behavior of rustdoc_include I want to depend on
At first I thought this was a bug, but then I looked at some use cases we have in TRPL and decided this was a feature that I'd like to use.
1 parent 4bebe40 commit a09bd23

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/utils/string.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,5 +242,11 @@ mod tests {
242242
take_rustdoc_include_anchored_lines(s, "something"),
243243
"# Lorem\n# ipsum\n# dolor\n# sit\n# amet\n# lorem\n# ipsum"
244244
);
245+
246+
let s = "Lorem\nANCHOR: test\nipsum\nANCHOR_END: test\ndolor\nANCHOR: test\nsit\nANCHOR_END: test\namet";
247+
assert_eq!(
248+
take_rustdoc_include_anchored_lines(s, "test"),
249+
"# Lorem\nipsum\n# dolor\nsit\n# amet"
250+
);
245251
}
246252
}

0 commit comments

Comments
 (0)