From 43b85035682f56a95d3ebbfae4cd6abfed0f3225 Mon Sep 17 00:00:00 2001 From: Tom Jakubowski Date: Thu, 5 Feb 2015 23:54:11 -0800 Subject: [PATCH] rustdoc: Clean up some htmldocck tests Fix #21740 --- src/test/run-make/rustdoc-hidden-line/foo.rs | 3 +-- .../run-make/rustdoc-negative-impl/foo.rs | 4 +-- src/test/run-make/rustdoc-where/foo.rs | 25 ++++++++++--------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/test/run-make/rustdoc-hidden-line/foo.rs b/src/test/run-make/rustdoc-hidden-line/foo.rs index c538a132fb1..3906d9ee8ae 100644 --- a/src/test/run-make/rustdoc-hidden-line/foo.rs +++ b/src/test/run-make/rustdoc-hidden-line/foo.rs @@ -32,5 +32,4 @@ pub fn foo() {} // @!has foo/fn.foo.html invisible -// @matches - //pre '#.*\[.*derive.*\(.*Eq.*\).*\].*//.*Bar' - +// @matches - //pre "#\[derive\(PartialEq\)\] // Bar" diff --git a/src/test/run-make/rustdoc-negative-impl/foo.rs b/src/test/run-make/rustdoc-negative-impl/foo.rs index eaa3af86563..b5fcbf46c5c 100644 --- a/src/test/run-make/rustdoc-negative-impl/foo.rs +++ b/src/test/run-make/rustdoc-negative-impl/foo.rs @@ -15,8 +15,8 @@ // @matches foo/struct.Bravo.html '//pre' "pub struct Bravo" pub struct Bravo; -// @matches foo/struct.Alpha.html '//*[@class="impl"]//code' "impl !.*Send.* for .*Alpha" +// @matches foo/struct.Alpha.html '//*[@class="impl"]//code' "impl !Send for Alpha" impl !Send for Alpha {} -// @matches foo/struct.Bravo.html '//*[@class="impl"]//code' "impl !.*Send.* for .*Bravo.*" +// @matches foo/struct.Bravo.html '//*[@class="impl"]//code' "impl !Send for Bravo" impl !Send for Bravo {} diff --git a/src/test/run-make/rustdoc-where/foo.rs b/src/test/run-make/rustdoc-where/foo.rs index 9f38ff13805..68fde60564e 100644 --- a/src/test/run-make/rustdoc-where/foo.rs +++ b/src/test/run-make/rustdoc-where/foo.rs @@ -10,29 +10,30 @@ pub trait MyTrait {} -// @matches foo/struct.Alpha.html '//pre' "Alpha.*where.*A:.*MyTrait" +// @has foo/struct.Alpha.html '//pre' "pub struct Alpha where A: MyTrait" pub struct Alpha where A: MyTrait; -// @matches foo/trait.Bravo.html '//pre' "Bravo.*where.*B:.*MyTrait" +// @has foo/trait.Bravo.html '//pre' "pub trait Bravo where B: MyTrait" pub trait Bravo where B: MyTrait {} -// @matches foo/fn.charlie.html '//pre' "charlie.*where.*C:.*MyTrait" +// @has foo/fn.charlie.html '//pre' "pub fn charlie() where C: MyTrait" pub fn charlie() where C: MyTrait {} pub struct Delta; -// @matches foo/struct.Delta.html '//*[@class="impl"]//code' "impl.*Delta.*where.*D:.*MyTrait" +// @has foo/struct.Delta.html '//*[@class="impl"]//code' \ +// "impl Delta where D: MyTrait" impl Delta where D: MyTrait { pub fn delta() {} } pub struct Echo; -// @matches foo/struct.Echo.html '//*[@class="impl"]//code' \ -// "impl.*MyTrait.*for.*Echo.*where.*E:.*MyTrait" -// @matches foo/trait.MyTrait.html '//*[@id="implementors-list"]//code' \ -// "impl.*MyTrait.*for.*Echo.*where.*E:.*MyTrait" +// @has foo/struct.Echo.html '//*[@class="impl"]//code' \ +// "impl MyTrait for Echo where E: MyTrait" +// @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//code' \ +// "impl MyTrait for Echo where E: MyTrait" impl MyTrait for Echo where E: MyTrait {} pub enum Foxtrot {} -// @matches foo/enum.Foxtrot.html '//*[@class="impl"]//code' \ -// "impl.*MyTrait.*for.*Foxtrot.*where.*F:.*MyTrait" -// @matches foo/trait.MyTrait.html '//*[@id="implementors-list"]//code' \ -// "impl.*MyTrait.*for.*Foxtrot.*where.*F:.*MyTrait" +// @has foo/enum.Foxtrot.html '//*[@class="impl"]//code' \ +// "impl MyTrait for Foxtrot where F: MyTrait" +// @has foo/trait.MyTrait.html '//*[@id="implementors-list"]//code' \ +// "impl MyTrait for Foxtrot where F: MyTrait" impl MyTrait for Foxtrot where F: MyTrait {} -- 2.44.0