Skip to content

Commit 9522a06

Browse files
committed
Update test calls to 'expect'
1 parent f05d7b4 commit 9522a06

File tree

1 file changed

+36
-22
lines changed

1 file changed

+36
-22
lines changed

crates/ra_ide/src/hover.rs

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,33 +1477,35 @@ fn foo() { let bar = Ba<|>r; }
14771477

14781478
#[test]
14791479
fn test_hover_path_link() {
1480-
check_hover_result(
1480+
check(
14811481
r"
14821482
//- /lib.rs
14831483
pub struct Foo;
14841484
/// [Foo](struct.Foo.html)
14851485
pub struct B<|>ar
14861486
",
1487-
&["pub struct Bar\n```\n___\n\n[Foo](https://docs.rs/test/*/test/struct.Foo.html)"],
1487+
expect![[
1488+
"pub struct Bar\n```\n___\n\n[Foo](https://docs.rs/test/*/test/struct.Foo.html)"
1489+
]],
14881490
);
14891491
}
14901492

14911493
#[test]
14921494
fn test_hover_path_link_no_strip() {
1493-
check_hover_result(
1495+
check(
14941496
r"
14951497
//- /lib.rs
14961498
pub struct Foo;
14971499
/// [struct Foo](struct.Foo.html)
14981500
pub struct B<|>ar
14991501
",
1500-
&["pub struct Bar\n```\n___\n\n[struct Foo](https://docs.rs/test/*/test/struct.Foo.html)"],
1502+
expect![["pub struct Bar\n```\n___\n\n[struct Foo](https://docs.rs/test/*/test/struct.Foo.html)"]],
15011503
);
15021504
}
15031505

15041506
#[test]
15051507
fn test_hover_intra_link() {
1506-
check_hover_result(
1508+
check(
15071509
r"
15081510
//- /lib.rs
15091511
pub mod foo {
@@ -1512,79 +1514,89 @@ fn foo() { let bar = Ba<|>r; }
15121514
/// [Foo](foo::Foo)
15131515
pub struct B<|>ar
15141516
",
1515-
&["pub struct Bar\n```\n___\n\n[Foo](https://docs.rs/test/*/test/foo/struct.Foo.html)"],
1517+
expect![["pub struct Bar\n```\n___\n\n[Foo](https://docs.rs/test/*/test/foo/struct.Foo.html)"]],
15161518
);
15171519
}
15181520

15191521
#[test]
15201522
fn test_hover_intra_link_shortlink() {
1521-
check_hover_result(
1523+
check(
15221524
r"
15231525
//- /lib.rs
15241526
pub struct Foo;
15251527
/// [Foo]
15261528
pub struct B<|>ar
15271529
",
1528-
&["pub struct Bar\n```\n___\n\n[Foo](https://docs.rs/test/*/test/struct.Foo.html)"],
1530+
expect![[
1531+
"pub struct Bar\n```\n___\n\n[Foo](https://docs.rs/test/*/test/struct.Foo.html)"
1532+
]],
15291533
);
15301534
}
15311535

15321536
#[test]
15331537
fn test_hover_intra_link_shortlink_code() {
1534-
check_hover_result(
1538+
check(
15351539
r"
15361540
//- /lib.rs
15371541
pub struct Foo;
15381542
/// [`Foo`]
15391543
pub struct B<|>ar
15401544
",
1541-
&["pub struct Bar\n```\n___\n\n[`Foo`](https://docs.rs/test/*/test/struct.Foo.html)"],
1545+
expect![[
1546+
"pub struct Bar\n```\n___\n\n[`Foo`](https://docs.rs/test/*/test/struct.Foo.html)"
1547+
]],
15421548
);
15431549
}
15441550

15451551
#[test]
15461552
fn test_hover_intra_link_namespaced() {
1547-
check_hover_result(
1553+
check(
15481554
r"
15491555
//- /lib.rs
15501556
pub struct Foo;
15511557
fn Foo() {}
15521558
/// [Foo()]
15531559
pub struct B<|>ar
15541560
",
1555-
&["pub struct Bar\n```\n___\n\n[Foo](https://docs.rs/test/*/test/struct.Foo.html)"],
1561+
expect![[
1562+
"pub struct Bar\n```\n___\n\n[Foo](https://docs.rs/test/*/test/struct.Foo.html)"
1563+
]],
15561564
);
15571565
}
15581566

15591567
#[test]
15601568
fn test_hover_intra_link_shortlink_namspaced_code() {
1561-
check_hover_result(
1569+
check(
15621570
r"
15631571
//- /lib.rs
15641572
pub struct Foo;
15651573
/// [`struct Foo`]
15661574
pub struct B<|>ar
15671575
",
1568-
&["pub struct Bar\n```\n___\n\n[`Foo`](https://docs.rs/test/*/test/struct.Foo.html)"],
1576+
expect![[
1577+
"pub struct Bar\n```\n___\n\n[`Foo`](https://docs.rs/test/*/test/struct.Foo.html)"
1578+
]],
15691579
);
15701580
}
15711581

15721582
#[test]
15731583
fn test_hover_intra_link_shortlink_namspaced_code_with_at() {
1574-
check_hover_result(
1584+
check(
15751585
r"
15761586
//- /lib.rs
15771587
pub struct Foo;
15781588
/// [`struct@Foo`]
15791589
pub struct B<|>ar
15801590
",
1581-
&["pub struct Bar\n```\n___\n\n[`Foo`](https://docs.rs/test/*/test/struct.Foo.html)"],
1591+
expect![[
1592+
"pub struct Bar\n```\n___\n\n[`Foo`](https://docs.rs/test/*/test/struct.Foo.html)"
1593+
]],
15821594
);
15831595
}
15841596

15851597
#[test]
15861598
fn test_hover_intra_link_reference() {
1587-
check_hover_result(
1599+
check(
15881600
r"
15891601
//- /lib.rs
15901602
pub struct Foo;
@@ -1593,34 +1605,36 @@ fn foo() { let bar = Ba<|>r; }
15931605
/// [foo]: Foo
15941606
pub struct B<|>ar
15951607
",
1596-
&["pub struct Bar\n```\n___\n\n[my Foo](https://docs.rs/test/*/test/struct.Foo.html)"],
1608+
expect![[
1609+
"pub struct Bar\n```\n___\n\n[my Foo](https://docs.rs/test/*/test/struct.Foo.html)"
1610+
]],
15971611
);
15981612
}
15991613

16001614
#[test]
16011615
fn test_hover_external_url() {
1602-
check_hover_result(
1616+
check(
16031617
r"
16041618
//- /lib.rs
16051619
pub struct Foo;
16061620
/// [external](https://www.google.com)
16071621
pub struct B<|>ar
16081622
",
1609-
&["pub struct Bar\n```\n___\n\n[external](https://www.google.com)"],
1623+
expect![["pub struct Bar\n```\n___\n\n[external](https://www.google.com)"]],
16101624
);
16111625
}
16121626

16131627
// Check that we don't rewrite links which we can't identify
16141628
#[test]
16151629
fn test_hover_unknown_target() {
1616-
check_hover_result(
1630+
check(
16171631
r"
16181632
//- /lib.rs
16191633
pub struct Foo;
16201634
/// [baz](Baz)
16211635
pub struct B<|>ar
16221636
",
1623-
&["pub struct Bar\n```\n___\n\n[baz](Baz)"],
1637+
expect![["pub struct Bar\n```\n___\n\n[baz](Baz)"]],
16241638
);
16251639
}
16261640

0 commit comments

Comments
 (0)