@@ -24,11 +24,39 @@ assert-text: (".block.method li:nth-child(2)", 'some_other_method_directly')
2424assert-text: (".block.method li:nth-child(3)", 'warning1')
2525assert-text: (".block.method li:nth-child(4)", 'warning2')
2626
27+ // Now try trait implementation merging and duplicate renumbering
28+ go-to: "file://" + |DOC_PATH| + "/test_docs/type.SomeOtherTypeWithMethodsAndInliningAndTraits.html"
29+
30+ // method directly on type alias
31+ assert: "//*[@id='method.as_ref']"
32+ assert-count: ("//*[@id='method.as_ref']", 1)
33+ // method on underlying type
34+ assert: "//*[@id='method.as_ref-1']"
35+
36+ // sidebar items
37+ assert-count: (
38+ "//*[@class='sidebar-elems']//h3/a[@href='#trait-implementations']",
39+ 1
40+ )
41+ assert-text: ("//*[@class='sidebar-elems']//li/a[@href='#impl-AsRef%3Cstr%3E-for-UnderlyingFooBarBaz']", "AsRef<str>")
42+ assert-text: (
43+ "//*[@class='sidebar-elems']//li/a[@href='#impl-AsRef%3Cu8%3E-for-UnderlyingFooBarBaz']",
44+ "AsRef<u8>"
45+ )
46+ assert-count: ("#trait-implementations-list", 1)
47+ assert-count: ("#trait-implementations-list > details", 2)
48+ // Both links point at the underlying trait
49+ store-property: ("//*[@id='method.as_ref']//a[@class='fn']", {"href": href})
50+ assert-property: ("//*[@id='method.as_ref-1']//a[@class='fn']", {"href": |href|})
51+ // Both links have a self-anchor
52+ assert: "//*[@id='method.as_ref']//a[@class='anchor'][@href='#method.as_ref']"
53+ assert: "//*[@id='method.as_ref-1']//a[@class='anchor'][@href='#method.as_ref-1']"
54+
2755///////////////////////////////////////////////////////////////////////////
2856// Now, if JavaScript is disabled, only the first method will be present //
2957///////////////////////////////////////////////////////////////////////////
3058javascript: false
31- reload:
59+ go-to: "file://" + |DOC_PATH| + "/test_docs/type.SomeOtherTypeWithMethodsAndInlining.html"
3260
3361// method directly on type alias
3462wait-for: "//*[@id='method.some_other_method_directly']"
@@ -37,3 +65,22 @@ wait-for: "//*[@id='method.some_other_method_directly']"
3765assert-false: "//*[@id='method.must_use']"
3866assert-false: "//*[@id='method.warning1']"
3967assert-false: "//*[@id='method.warning2']"
68+
69+ // Now try trait implementation merging and duplicate renumbering
70+ go-to: "file://" + |DOC_PATH| + "/test_docs/type.SomeOtherTypeWithMethodsAndInliningAndTraits.html"
71+
72+ // methods directly on type alias
73+ assert: "//*[@id='method.as_ref']"
74+ assert-count: ("//*[@id='method.as_ref']", 1)
75+ // method on target type
76+ assert-false: "//*[@id='method.as_ref-1']"
77+
78+ // sidebar items
79+ assert-count: (
80+ "//*[@class='sidebar-elems']//h3/a[@href='#trait-implementations']",
81+ 1
82+ )
83+ assert-false: "//a[@href='#impl-AsRef%3Cstr%3E-for-UnderlyingFooBarBaz']"
84+ assert: "//a[@href='#impl-AsRef%3Cu8%3E-for-UnderlyingFooBarBaz']"
85+ assert-count: ("#trait-implementations-list", 1)
86+ assert-count: ("#trait-implementations-list > details", 1)
0 commit comments