]> git.lizzy.rs Git - rust.git/commitdiff
Use XPATH notation to match against flattened nodes
authorPhilip Munksgaard <pmunksgaard@gmail.com>
Wed, 10 Oct 2018 19:04:52 +0000 (21:04 +0200)
committerPhilip Munksgaard <pmunksgaard@gmail.com>
Wed, 10 Oct 2018 19:04:52 +0000 (21:04 +0200)
The generated code would look like `<code>impl <a href="...">Foo</a></code>`
which the plain text matcher doesn't match. But by using the XPATH notation, the
nodes are flattened and we can correctly assert that `impl Foo` does not occur
in the generated docs.

src/test/rustdoc/hidden-methods.rs

index 18f5f086cd1a4ea85ad386c2c6831daf26bfa25e..aea5f44e2a72370d044fd9f100576ac669a2a2be 100644 (file)
@@ -28,12 +28,12 @@ fn this_should_be_hidden() {}
 
 // @has foo/struct.Foo.html
 // @!has - 'Methods'
-// @!has - 'impl Foo'
+// @!has - '//code' 'impl Foo'
 // @!has - 'this_should_be_hidden'
 pub use hidden::Foo;
 
 // @has foo/struct.Bar.html
 // @!has - 'Methods'
-// @!has - 'impl Bar'
+// @!has - '//code' 'impl Bar'
 // @!has - 'this_should_be_hidden'
 pub use hidden::Bar;