From d3f75ebf609eed01b39fb7528745f2fce88e33e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Wed, 24 Feb 2021 18:14:31 +0100 Subject: [PATCH] Add test --- src/librustdoc/html/render/tests.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) 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()); +}