1 // First a module with inner documentation
3 // @has issue_55364/subone/index.html
4 // These foo/bar links in the module's documentation should refer inside `subone`
5 // @has - '//section[@id="main-content"]/details[@open=""]/div[@class="docblock"]//a[@href="fn.foo.html"]' 'foo'
6 // @has - '//section[@id="main-content"]/details[@open=""]/div[@class="docblock"]//a[@href="fn.bar.html"]' 'bar'
8 //! See either [foo] or [bar].
10 // This should refer to subone's `bar`
11 // @has issue_55364/subone/fn.foo.html
12 // @has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="fn.bar.html"]' 'bar'
15 // This should refer to subone's `foo`
16 // @has issue_55364/subone/fn.bar.html
17 // @has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="fn.foo.html"]' 'foo'
22 // A module with outer documentation
24 // @has issue_55364/subtwo/index.html
25 // These foo/bar links in the module's documentation should not reference inside `subtwo`
26 // @!has - '//section[@id="main-content"]/div[@class="docblock"]//a[@href="fn.foo.html"]' 'foo'
27 // @!has - '//section[@id="main-content"]/div[@class="docblock"]//a[@href="fn.bar.html"]' 'bar'
28 // Instead it should be referencing the top level functions
29 // @has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="../fn.foo.html"]' 'foo'
30 // @has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="../fn.bar.html"]' 'bar'
31 // Though there should be such links later
32 // @has - '//section[@id="main-content"]/div[@class="item-table"]//div[@class="item-left module-item"]/a[@class="fn"][@href="fn.foo.html"]' 'foo'
33 // @has - '//section[@id="main-content"]/div[@class="item-table"]//div[@class="item-left module-item"]/a[@class="fn"][@href="fn.bar.html"]' 'bar'
34 /// See either [foo] or [bar].
37 // Despite the module's docs referring to the top level foo/bar,
38 // this should refer to subtwo's `bar`
39 // @has issue_55364/subtwo/fn.foo.html
40 // @has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="fn.bar.html"]' 'bar'
43 // Despite the module's docs referring to the top level foo/bar,
44 // this should refer to subtwo's `foo`
45 // @has issue_55364/subtwo/fn.bar.html
46 // @has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="fn.foo.html"]' 'foo'
51 // These are the function referred to by the module above with outer docs
58 // This module refers to the outer foo/bar by means of `super::`
60 // @has issue_55364/subthree/index.html
61 // This module should also refer to the top level foo/bar
62 // @has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="../fn.foo.html"]' 'foo'
63 // @has - '//section[@id="main-content"]/details/div[@class="docblock"]//a[@href="../fn.bar.html"]' 'bar'
65 //! See either [foo][super::foo] or [bar][super::bar]
68 // Next we go *deeper* - In order to ensure it's not just "this or parent"
69 // we test `crate::` and a `super::super::...` chain
70 // @has issue_55364/subfour/subfive/subsix/subseven/subeight/index.html
71 // @has - '//section[@id="main-content"]/div[@class="item-table"]//div[@class="item-right docblock-short"]//a[@href="../../../../../subone/fn.foo.html"]' 'other foo'
72 // @has - '//section[@id="main-content"]/div[@class="item-table"]//div[@class="item-right docblock-short"]//a[@href="../../../../../subtwo/fn.bar.html"]' 'other bar'
78 /// See [other foo][crate::subone::foo]
80 /// See [other bar][super::super::super::super::super::subtwo::bar]