diff options
| author | Dániel Buga <bugadani@gmail.com> | 2021-02-24 18:14:31 +0100 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2021-03-10 15:42:59 -0800 |
| commit | 3ad36d242a868855b8b66ac404e387d5787e4680 (patch) | |
| tree | c2544e1e0124cb637aa4bed9f04c90ec6bc90656 | |
| parent | 0e214cab6654a09b88545768476604fa7906df80 (diff) | |
| download | rust-3ad36d242a868855b8b66ac404e387d5787e4680.tar.gz rust-3ad36d242a868855b8b66ac404e387d5787e4680.zip | |
Add test
(cherry picked from commit d3f75ebf609eed01b39fb7528745f2fce88e33e6)
| -rw-r--r-- | src/librustdoc/html/render/tests.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/librustdoc/html/render/tests.rs b/src/librustdoc/html/render/tests.rs index abf5f05fe58..224c794fb3b 100644 --- a/src/librustdoc/html/render/tests.rs +++ b/src/librustdoc/html/render/tests.rs @@ -38,3 +38,14 @@ fn test_name_sorting() { sorted.sort_by(|&l, r| compare_names(l, r)); assert_eq!(names, sorted); } + +#[test] +fn test_all_types_prints_header_once() { + // Regression test for #82477 + let all_types = AllTypes::new(); + + let mut buffer = Buffer::new(); + all_types.print(&mut buffer); + + assert_eq!(1, buffer.into_inner().matches("List of all items").count()); +} |
