Skip to content

Commit

Permalink
Update existing snapshot and add more snapshots of where clause inden…
Browse files Browse the repository at this point in the history
…tation
  • Loading branch information
GuillaumeGomez committed Jun 22, 2023
1 parent 9202caa commit b858a47
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 1 deletion.
2 changes: 2 additions & 0 deletions tests/rustdoc/where.SWhere_Echo_impl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<h3 class="code-header">impl&lt;D&gt; <a class="struct" href="struct.Delta.html" title="struct foo::Delta">Delta</a>&lt;D&gt;<span class="where fmt-newline">where
D: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a>,</span></h3>
2 changes: 1 addition & 1 deletion tests/rustdoc/where.SWhere_Simd_item-decl.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<pre class="rust item-decl"><code>pub struct Simd&lt;T&gt;(_)
<span class="where">where
T: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a></span>;</code></pre>
T: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a></span>;</code></pre>
3 changes: 3 additions & 0 deletions tests/rustdoc/where.alpha_trait_decl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<code>pub struct Alpha&lt;A&gt;(_)
<span class="where">where
A: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a></span>;</code>
5 changes: 5 additions & 0 deletions tests/rustdoc/where.bravo_trait_decl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<code>pub trait Bravo&lt;B&gt;<span class="where fmt-newline">where
B: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a>,</span>{
// Required method
fn <a href="#tymethod.get" class="fn">get</a>(&amp;self, B: B);
}</code>
2 changes: 2 additions & 0 deletions tests/rustdoc/where.charlie_fn_decl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<code>pub fn charlie&lt;C&gt;()<span class="where fmt-newline">where
C: <a class="trait" href="trait.MyTrait.html" title="trait foo::MyTrait">MyTrait</a>,</span></code>
2 changes: 2 additions & 0 deletions tests/rustdoc/where.golf_type_alias_decl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<code>pub type Golf&lt;T&gt;<span class="where fmt-newline">where
T: <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a>,</span> = <a class="primitive" href="{{channel}}/std/primitive.tuple.html">(T, T)</a>;</code>
5 changes: 5 additions & 0 deletions tests/rustdoc/where.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,20 @@ use std::io::Lines;
pub trait MyTrait { fn dummy(&self) { } }

// @has foo/struct.Alpha.html '//pre' "pub struct Alpha<A>(_) where A: MyTrait"
// @snapshot alpha_trait_decl - '//*[@class="rust item-decl"]/code'
pub struct Alpha<A>(A) where A: MyTrait;
// @has foo/trait.Bravo.html '//pre' "pub trait Bravo<B>where B: MyTrait"
// @snapshot bravo_trait_decl - '//*[@class="rust item-decl"]/code'
pub trait Bravo<B> where B: MyTrait { fn get(&self, B: B); }
// @has foo/fn.charlie.html '//pre' "pub fn charlie<C>()where C: MyTrait"
// @snapshot charlie_fn_decl - '//*[@class="rust item-decl"]/code'
pub fn charlie<C>() where C: MyTrait {}

pub struct Delta<D>(D);

// @has foo/struct.Delta.html '//*[@class="impl"]//h3[@class="code-header"]' \
// "impl<D> Delta<D>where D: MyTrait"
// @snapshot SWhere_Echo_impl - '//*[@id="impl-Delta%3CD%3E"]/h3[@class="code-header"]'
impl<D> Delta<D> where D: MyTrait {
pub fn delta() {}
}
Expand Down Expand Up @@ -65,4 +69,5 @@ impl<F> MyTrait for Foxtrot<F>where F: MyTrait {}

// @has foo/type.Golf.html '//pre[@class="rust item-decl"]' \
// "type Golf<T>where T: Clone, = (T, T)"
// @snapshot golf_type_alias_decl - '//*[@class="rust item-decl"]/code'
pub type Golf<T> where T: Clone = (T, T);

0 comments on commit b858a47

Please sign in to comment.