Skip to content

Commit 669498c

Browse files
committed
rustdoc: fix test cases
1 parent ef24747 commit 669498c

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

src/test/rustdoc/check-source-code-urls-to-def-std.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ fn babar() {}
99
// @has - '//a[@href="{{channel}}/std/primitive.u32.html"]' 'u32'
1010
// @has - '//a[@href="{{channel}}/std/primitive.str.html"]' 'str'
1111
// @has - '//a[@href="{{channel}}/std/primitive.bool.html"]' 'bool'
12-
// @has - '//a[@href="../../src/foo/check-source-code-urls-to-def-std.rs.html#7"]' 'babar'
12+
// @has - '//a[@href="#7"]' 'babar'
1313
pub fn foo(a: u32, b: &str, c: String) {
1414
let x = 12;
1515
let y: bool = true;
@@ -31,12 +31,12 @@ macro_rules! data {
3131
pub fn another_foo() {
3232
// This is known limitation: if the macro doesn't generate anything, the visitor
3333
// can't find any item or anything that could tell us that it comes from expansion.
34-
// @!has - '//a[@href="../../src/foo/check-source-code-urls-to-def-std.rs.html#19"]' 'yolo!'
34+
// @!has - '//a[@href="#19"]' 'yolo!'
3535
yolo!();
3636
// @has - '//a[@href="{{channel}}/std/macro.eprintln.html"]' 'eprintln!'
3737
eprintln!();
38-
// @has - '//a[@href="../../src/foo/check-source-code-urls-to-def-std.rs.html#27-29"]' 'data!'
38+
// @has - '//a[@href="#27-29"]' 'data!'
3939
let x = data!(4);
40-
// @has - '//a[@href="../../src/foo/check-source-code-urls-to-def-std.rs.html#23-25"]' 'bar!'
40+
// @has - '//a[@href="#23-25"]' 'bar!'
4141
bar!(x);
4242
}

src/test/rustdoc/check-source-code-urls-to-def.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ extern crate source_code;
1010

1111
// @has 'src/foo/check-source-code-urls-to-def.rs.html'
1212

13-
// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#1-17"]' 'bar'
13+
// @has - '//a[@href="auxiliary/source-code-bar.rs.html#1-17"]' 'bar'
1414
#[path = "auxiliary/source-code-bar.rs"]
1515
pub mod bar;
1616

17-
// @count - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#5"]' 4
17+
// @count - '//a[@href="auxiliary/source-code-bar.rs.html#5"]' 4
1818
use bar::Bar;
19-
// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#13"]' 'self'
20-
// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14"]' 'Trait'
19+
// @has - '//a[@href="auxiliary/source-code-bar.rs.html#13"]' 'self'
20+
// @has - '//a[@href="auxiliary/source-code-bar.rs.html#14"]' 'Trait'
2121
use bar::sub::{self, Trait};
2222

2323
pub struct Foo;
@@ -31,26 +31,26 @@ fn babar() {}
3131
// @has - '//a/@href' '/struct.String.html'
3232
// @has - '//a/@href' '/primitive.u32.html'
3333
// @has - '//a/@href' '/primitive.str.html'
34-
// @count - '//a[@href="../../src/foo/check-source-code-urls-to-def.rs.html#23"]' 5
34+
// @count - '//a[@href="#23"]' 5
3535
// @has - '//a[@href="../../source_code/struct.SourceCode.html"]' 'source_code::SourceCode'
3636
pub fn foo(a: u32, b: &str, c: String, d: Foo, e: bar::Bar, f: source_code::SourceCode) {
3737
let x = 12;
3838
let y: Foo = Foo;
3939
let z: Bar = bar::Bar { field: Foo };
4040
babar();
41-
// @has - '//a[@href="../../src/foo/check-source-code-urls-to-def.rs.html#26"]' 'hello'
41+
// @has - '//a[@href="#26"]' 'hello'
4242
y.hello();
4343
}
4444

45-
// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14"]' 'bar::sub::Trait'
46-
// @has - '//a[@href="../../src/foo/auxiliary/source-code-bar.rs.html#14"]' 'Trait'
45+
// @has - '//a[@href="auxiliary/source-code-bar.rs.html#14"]' 'bar::sub::Trait'
46+
// @has - '//a[@href="auxiliary/source-code-bar.rs.html#14"]' 'Trait'
4747
pub fn foo2<T: bar::sub::Trait, V: Trait>(t: &T, v: &V, b: bool) {}
4848

4949
pub trait AnotherTrait {}
5050
pub trait WhyNot {}
5151

52-
// @has - '//a[@href="../../src/foo/check-source-code-urls-to-def.rs.html#49"]' 'AnotherTrait'
53-
// @has - '//a[@href="../../src/foo/check-source-code-urls-to-def.rs.html#50"]' 'WhyNot'
52+
// @has - '//a[@href="#49"]' 'AnotherTrait'
53+
// @has - '//a[@href="#50"]' 'WhyNot'
5454
pub fn foo3<T, V>(t: &T, v: &V)
5555
where
5656
T: AnotherTrait,
@@ -59,7 +59,7 @@ where
5959

6060
pub trait AnotherTrait2 {}
6161

62-
// @has - '//a[@href="../../src/foo/check-source-code-urls-to-def.rs.html#60"]' 'AnotherTrait2'
62+
// @has - '//a[@href="#60"]' 'AnotherTrait2'
6363
pub fn foo4() {
6464
let x: Vec<AnotherTrait2> = Vec::new();
6565
}

0 commit comments

Comments
 (0)