File tree 4 files changed +35
-0
lines changed
4 files changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ // This test checks the intra doc links to code examples.
2
+ go-to: "file://" + |DOC_PATH| + "/scrape_examples/index.html"
3
+
4
+ assert-attribute: (
5
+ "//a[text()='check']",
6
+ {
7
+ "href": "../src/check/check.rs.html",
8
+ "title": "Example check",
9
+ },
10
+ )
11
+ assert-attribute: (
12
+ "//a[text()='check/check.rs']",
13
+ {
14
+ "href": "../src/check/check.rs.html",
15
+ "title": "Example check",
16
+ },
17
+ )
18
+ assert-attribute: (
19
+ "//a[text()='check/sub.rs']",
20
+ {
21
+ "href": "../src/check/sub.rs.html",
22
+ "title": "Example check",
23
+ },
24
+ )
25
+ // We now click on the link to ensure it works.
26
+ click: "//a[text()='check/sub.rs']"
27
+ wait-for-text: (".main-heading h1", "check/sub.rs")
Original file line number Diff line number Diff line change
1
+ mod sub;
2
+
1
3
fn main ( ) {
4
+ sub:: foo ( ) ;
5
+
2
6
for i in 0 ..9 {
3
7
println ! ( "hello world!" ) ;
4
8
println ! ( "hello world!" ) ;
Original file line number Diff line number Diff line change
1
+ pub fn foo ( ) { }
Original file line number Diff line number Diff line change 1
1
//@ run-flags:-Zrustdoc-scrape-examples
2
+
3
+ //! [example@check] [example@check/check.rs] [example@check/sub.rs]
4
+
2
5
/// # Examples
3
6
///
4
7
/// ```
You can’t perform that action at this time.
0 commit comments