Skip to content

Commit

Permalink
Add a test for a behavior of rustdoc_include I want to depend on
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
carols10cents committed Aug 23, 2019
1 parent 4bebe40 commit a09bd23
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/utils/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,5 +242,11 @@ mod tests {
take_rustdoc_include_anchored_lines(s, "something"),
"# Lorem\n# ipsum\n# dolor\n# sit\n# amet\n# lorem\n# ipsum"
);

let s = "Lorem\nANCHOR: test\nipsum\nANCHOR_END: test\ndolor\nANCHOR: test\nsit\nANCHOR_END: test\namet";
assert_eq!(
take_rustdoc_include_anchored_lines(s, "test"),
"# Lorem\nipsum\n# dolor\nsit\n# amet"
);
}
}

0 comments on commit a09bd23

Please sign in to comment.