@@ -1477,33 +1477,35 @@ fn foo() { let bar = Ba<|>r; }
1477
1477
1478
1478
#[ test]
1479
1479
fn test_hover_path_link ( ) {
1480
- check_hover_result (
1480
+ check (
1481
1481
r"
1482
1482
//- /lib.rs
1483
1483
pub struct Foo;
1484
1484
/// [Foo](struct.Foo.html)
1485
1485
pub struct B<|>ar
1486
1486
" ,
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
+ ] ] ,
1488
1490
) ;
1489
1491
}
1490
1492
1491
1493
#[ test]
1492
1494
fn test_hover_path_link_no_strip ( ) {
1493
- check_hover_result (
1495
+ check (
1494
1496
r"
1495
1497
//- /lib.rs
1496
1498
pub struct Foo;
1497
1499
/// [struct Foo](struct.Foo.html)
1498
1500
pub struct B<|>ar
1499
1501
" ,
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)" ] ] ,
1501
1503
) ;
1502
1504
}
1503
1505
1504
1506
#[ test]
1505
1507
fn test_hover_intra_link ( ) {
1506
- check_hover_result (
1508
+ check (
1507
1509
r"
1508
1510
//- /lib.rs
1509
1511
pub mod foo {
@@ -1512,79 +1514,89 @@ fn foo() { let bar = Ba<|>r; }
1512
1514
/// [Foo](foo::Foo)
1513
1515
pub struct B<|>ar
1514
1516
" ,
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)" ] ] ,
1516
1518
) ;
1517
1519
}
1518
1520
1519
1521
#[ test]
1520
1522
fn test_hover_intra_link_shortlink ( ) {
1521
- check_hover_result (
1523
+ check (
1522
1524
r"
1523
1525
//- /lib.rs
1524
1526
pub struct Foo;
1525
1527
/// [Foo]
1526
1528
pub struct B<|>ar
1527
1529
" ,
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
+ ] ] ,
1529
1533
) ;
1530
1534
}
1531
1535
1532
1536
#[ test]
1533
1537
fn test_hover_intra_link_shortlink_code ( ) {
1534
- check_hover_result (
1538
+ check (
1535
1539
r"
1536
1540
//- /lib.rs
1537
1541
pub struct Foo;
1538
1542
/// [`Foo`]
1539
1543
pub struct B<|>ar
1540
1544
" ,
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
+ ] ] ,
1542
1548
) ;
1543
1549
}
1544
1550
1545
1551
#[ test]
1546
1552
fn test_hover_intra_link_namespaced ( ) {
1547
- check_hover_result (
1553
+ check (
1548
1554
r"
1549
1555
//- /lib.rs
1550
1556
pub struct Foo;
1551
1557
fn Foo() {}
1552
1558
/// [Foo()]
1553
1559
pub struct B<|>ar
1554
1560
" ,
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
+ ] ] ,
1556
1564
) ;
1557
1565
}
1558
1566
1559
1567
#[ test]
1560
1568
fn test_hover_intra_link_shortlink_namspaced_code ( ) {
1561
- check_hover_result (
1569
+ check (
1562
1570
r"
1563
1571
//- /lib.rs
1564
1572
pub struct Foo;
1565
1573
/// [`struct Foo`]
1566
1574
pub struct B<|>ar
1567
1575
" ,
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
+ ] ] ,
1569
1579
) ;
1570
1580
}
1571
1581
1572
1582
#[ test]
1573
1583
fn test_hover_intra_link_shortlink_namspaced_code_with_at ( ) {
1574
- check_hover_result (
1584
+ check (
1575
1585
r"
1576
1586
//- /lib.rs
1577
1587
pub struct Foo;
1578
1588
/// [`struct@Foo`]
1579
1589
pub struct B<|>ar
1580
1590
" ,
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
+ ] ] ,
1582
1594
) ;
1583
1595
}
1584
1596
1585
1597
#[ test]
1586
1598
fn test_hover_intra_link_reference ( ) {
1587
- check_hover_result (
1599
+ check (
1588
1600
r"
1589
1601
//- /lib.rs
1590
1602
pub struct Foo;
@@ -1593,34 +1605,36 @@ fn foo() { let bar = Ba<|>r; }
1593
1605
/// [foo]: Foo
1594
1606
pub struct B<|>ar
1595
1607
" ,
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
+ ] ] ,
1597
1611
) ;
1598
1612
}
1599
1613
1600
1614
#[ test]
1601
1615
fn test_hover_external_url ( ) {
1602
- check_hover_result (
1616
+ check (
1603
1617
r"
1604
1618
//- /lib.rs
1605
1619
pub struct Foo;
1606
1620
/// [external](https://www.google.com)
1607
1621
pub struct B<|>ar
1608
1622
" ,
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)" ] ] ,
1610
1624
) ;
1611
1625
}
1612
1626
1613
1627
// Check that we don't rewrite links which we can't identify
1614
1628
#[ test]
1615
1629
fn test_hover_unknown_target ( ) {
1616
- check_hover_result (
1630
+ check (
1617
1631
r"
1618
1632
//- /lib.rs
1619
1633
pub struct Foo;
1620
1634
/// [baz](Baz)
1621
1635
pub struct B<|>ar
1622
1636
" ,
1623
- & [ "pub struct Bar\n ```\n ___\n \n [baz](Baz)" ] ,
1637
+ expect ! [ [ "pub struct Bar\n ```\n ___\n \n [baz](Baz)" ] ] ,
1624
1638
) ;
1625
1639
}
1626
1640
0 commit comments