Skip to content

Commit

Permalink
Simplify docfragment transformation in unindent tests
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jan 2, 2021
1 parent d0e7523 commit df2df14
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/librustdoc/passes/unindent_comments/tests.rs
Expand Up @@ -20,20 +20,7 @@ fn run_test(input: &str, expected: &str) {
with_default_session_globals(|| {
let mut s = create_doc_fragment(input);
unindent_fragments(&mut s);
assert_eq!(
&s[0]
.doc
.as_str()
.lines()
.map(|l| if l.len() > s[0].indent {
l[s[0].indent..].to_string()
} else {
String::new()
})
.collect::<Vec<_>>()
.join("\n"),
expected
);
assert_eq!(&s.iter().collect::<String>(), expected);
});
}

Expand Down

0 comments on commit df2df14

Please sign in to comment.