Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
6d44879e
R
Rust
项目概览
int
/
Rust
12 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6d44879e
编写于
7月 12, 2023
作者:
G
Guillaume Gomez
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update jump to def tests
上级
3fd36bc0
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
64 addition
and
12 deletion
+64
-12
tests/rustdoc-gui/source-anchor-scroll.goml
tests/rustdoc-gui/source-anchor-scroll.goml
+3
-3
tests/rustdoc/check-source-code-urls-to-def.rs
tests/rustdoc/check-source-code-urls-to-def.rs
+10
-9
tests/rustdoc/jump-to-def-doc-links.rs
tests/rustdoc/jump-to-def-doc-links.rs
+51
-0
未找到文件。
tests/rustdoc-gui/source-anchor-scroll.goml
浏览文件 @
6d44879e
...
...
@@ -7,11 +7,11 @@ set-window-size: (600, 800)
// We check that the scroll is at the top first.
assert-property: ("html", {"scrollTop": "0"})
click: '//a[text() = "barbar"]'
click: '//a[text() = "barbar"
and @href="#5-7"
]'
assert-property: ("html", {"scrollTop": "149"})
click: '//a[text() = "bar"]'
click: '//a[text() = "bar"
and @href="#28-36"
]'
assert-property: ("html", {"scrollTop": "180"})
click: '//a[text() = "sub_fn"]'
click: '//a[text() = "sub_fn"
and @href="#2-4"
]'
assert-property: ("html", {"scrollTop": "77"})
// We now check that clicking on lines doesn't change the scroll
...
...
tests/rustdoc/check-source-code-urls-to-def.rs
浏览文件 @
6d44879e
...
...
@@ -14,10 +14,10 @@
#[path
=
"auxiliary/source-code-bar.rs"
]
pub
mod
bar
;
// @count - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#5"]' 4
// @count - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#5
-7
"]' 4
use
bar
::
Bar
;
// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#13"]' 'self'
// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#14"]' 'Trait'
// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#13
-17
"]' 'self'
// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#14
-16
"]' 'Trait'
use
bar
::
sub
::{
self
,
Trait
};
pub
struct
Foo
;
...
...
@@ -32,7 +32,8 @@ fn babar() {}
// @has - '//pre[@class="rust"]//a/@href' '/primitive.u32.html'
// @has - '//pre[@class="rust"]//a/@href' '/primitive.str.html'
// @count - '//pre[@class="rust"]//a[@href="#23"]' 5
// @has - '//pre[@class="rust"]//a[@href="../../source_code/struct.SourceCode.html"]' 'source_code::SourceCode'
// @has - '//pre[@class="rust"]//a[@href="../../source_code/struct.SourceCode.html"]' \
// 'source_code::SourceCode'
pub
fn
foo
(
a
:
u32
,
b
:
&
str
,
c
:
String
,
d
:
Foo
,
e
:
bar
::
Bar
,
f
:
source_code
::
SourceCode
)
{
let
x
=
12
;
let
y
:
Foo
=
Foo
;
...
...
@@ -42,15 +43,15 @@ pub fn foo(a: u32, b: &str, c: String, d: Foo, e: bar::Bar, f: source_code::Sour
y
.hello
();
}
// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#14"]' 'bar::sub::Trait'
// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#14"]' 'Trait'
// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#14
-16
"]' 'bar::sub::Trait'
// @has - '//pre[@class="rust"]//a[@href="auxiliary/source-code-bar.rs.html#14
-16
"]' 'Trait'
pub
fn
foo2
<
T
:
bar
::
sub
::
Trait
,
V
:
Trait
>
(
t
:
&
T
,
v
:
&
V
,
b
:
bool
)
{}
pub
trait
AnotherTrait
{}
pub
trait
WhyNot
{}
// @has - '//pre[@class="rust"]//a[@href="#
49
"]' 'AnotherTrait'
// @has - '//pre[@class="rust"]//a[@href="#5
0
"]' 'WhyNot'
// @has - '//pre[@class="rust"]//a[@href="#
50
"]' 'AnotherTrait'
// @has - '//pre[@class="rust"]//a[@href="#5
1
"]' 'WhyNot'
pub
fn
foo3
<
T
,
V
>
(
t
:
&
T
,
v
:
&
V
)
where
T
:
AnotherTrait
,
...
...
@@ -59,7 +60,7 @@ pub fn foo3<T, V>(t: &T, v: &V)
pub
trait
AnotherTrait2
{}
// @has - '//pre[@class="rust"]//a[@href="#6
0
"]' 'AnotherTrait2'
// @has - '//pre[@class="rust"]//a[@href="#6
1
"]' 'AnotherTrait2'
pub
fn
foo4
()
{
let
x
:
Vec
<
AnotherTrait2
>
=
Vec
::
new
();
}
...
...
tests/rustdoc/jump-to-def-doc-links.rs
0 → 100644
浏览文件 @
6d44879e
// compile-flags: -Zunstable-options --generate-link-to-definition
#![crate_name
=
"foo"
]
// @has 'src/foo/jump-to-def-doc-links.rs.html'
// @has - '//a[@href="../../foo/struct.Bar.html"]' 'Bar'
// @has - '//a[@href="../../foo/struct.Foo.html"]' 'Foo'
pub
struct
Bar
;
pub
struct
Foo
;
// @has - '//a[@href="../../foo/enum.Enum.html"]' 'Enum'
pub
enum
Enum
{
Variant1
(
String
),
Variant2
(
u8
),
}
// @has - '//a[@href="../../foo/struct.Struct.html"]' 'Struct'
pub
struct
Struct
{
pub
a
:
u8
,
b
:
Foo
,
}
impl
Struct
{
pub
fn
foo
()
{}
pub
fn
foo2
(
&
self
)
{}
fn
bar
()
{}
fn
bar
(
&
self
)
{}
}
// @has - '//a[@href="../../foo/trait.Trait.html"]' 'Trait'
pub
trait
Trait
{
fn
foo
();
}
impl
Trait
for
Struct
{
fn
foo
()
{}
}
// @has - '//a[@href="../../foo/union.Union.html"]' 'Union'
pub
union
Union
{
pub
a
:
u16
,
pub
f
:
u32
,
}
// @has - '//a[@href="../../foo/fn.bar.html"]' 'bar'
pub
fn
bar
(
b
:
Bar
)
{
let
x
=
Foo
;
}
// @has - '//a[@href="../../foo/bar/index.html"]' 'bar'
pub
mod
bar
{}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录