mirror of
https://github.com/rust-lang/mdBook
synced 2024-12-14 23:02:34 +00:00
Links preprocessor: test links with special characters
This commit is contained in:
parent
11f95f76e6
commit
d665732056
1 changed files with 18 additions and 0 deletions
|
@ -451,6 +451,24 @@ mod tests {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_find_links_with_special_characters() {
|
||||||
|
let s = "Some random text with {{#playpen foo-bar\\baz/_c++.rs}}...";
|
||||||
|
|
||||||
|
let res = find_links(s).collect::<Vec<_>>();
|
||||||
|
println!("\nOUTPUT: {:?}\n", res);
|
||||||
|
|
||||||
|
assert_eq!(
|
||||||
|
res,
|
||||||
|
vec![Link {
|
||||||
|
start_index: 22,
|
||||||
|
end_index: 54,
|
||||||
|
link_type: LinkType::Playpen(PathBuf::from("foo-bar\\baz/_c++.rs"), vec![]),
|
||||||
|
link_text: "{{#playpen foo-bar\\baz/_c++.rs}}",
|
||||||
|
},]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_find_links_with_range() {
|
fn test_find_links_with_range() {
|
||||||
let s = "Some random text with {{#include file.rs:10:20}}...";
|
let s = "Some random text with {{#include file.rs:10:20}}...";
|
||||||
|
|
Loading…
Reference in a new issue