File tree Expand file tree Collapse file tree 1 file changed +47
-23
lines changed Expand file tree Collapse file tree 1 file changed +47
-23
lines changed Original file line number Diff line number Diff line change @@ -581,14 +581,8 @@ mod tests {
581
581
fn check_tests ( ra_fixture : & str , expect : Expect ) {
582
582
let ( analysis, position) = fixture:: position ( ra_fixture) ;
583
583
let tests = analysis. related_tests ( position, None ) . unwrap ( ) ;
584
- let test_ids = tests
585
- . into_iter ( )
586
- . map ( |runnable| match runnable. kind {
587
- RunnableKind :: Test { test_id, .. } => test_id,
588
- _ => unreachable ! ( ) ,
589
- } )
590
- . collect :: < Vec < _ > > ( ) ;
591
- expect. assert_debug_eq ( & test_ids) ;
584
+ let navigation_targets = tests. into_iter ( ) . map ( |runnable| runnable. nav ) . collect :: < Vec < _ > > ( ) ;
585
+ expect. assert_debug_eq ( & navigation_targets) ;
592
586
}
593
587
594
588
#[ test]
@@ -1637,9 +1631,15 @@ mod tests {
1637
1631
"# ,
1638
1632
expect ! [ [ r#"
1639
1633
[
1640
- Path(
1641
- "tests::foo_test",
1642
- ),
1634
+ NavigationTarget {
1635
+ file_id: FileId(
1636
+ 0,
1637
+ ),
1638
+ full_range: 31..85,
1639
+ focus_range: 46..54,
1640
+ name: "foo_test",
1641
+ kind: Function,
1642
+ },
1643
1643
]
1644
1644
"# ] ] ,
1645
1645
) ;
@@ -1664,9 +1664,15 @@ mod tests {
1664
1664
"# ,
1665
1665
expect ! [ [ r#"
1666
1666
[
1667
- Path(
1668
- "tests::foo_test",
1669
- ),
1667
+ NavigationTarget {
1668
+ file_id: FileId(
1669
+ 0,
1670
+ ),
1671
+ full_range: 71..122,
1672
+ focus_range: 86..94,
1673
+ name: "foo_test",
1674
+ kind: Function,
1675
+ },
1670
1676
]
1671
1677
"# ] ] ,
1672
1678
) ;
@@ -1698,9 +1704,15 @@ mod tests {
1698
1704
"# ,
1699
1705
expect ! [ [ r#"
1700
1706
[
1701
- Path(
1702
- "tests::foo_test",
1703
- ),
1707
+ NavigationTarget {
1708
+ file_id: FileId(
1709
+ 0,
1710
+ ),
1711
+ full_range: 133..183,
1712
+ focus_range: 148..156,
1713
+ name: "foo_test",
1714
+ kind: Function,
1715
+ },
1704
1716
]
1705
1717
"# ] ] ,
1706
1718
) ;
@@ -1732,12 +1744,24 @@ mod tests {
1732
1744
"# ,
1733
1745
expect ! [ [ r#"
1734
1746
[
1735
- Path(
1736
- "tests::foo2_test",
1737
- ),
1738
- Path(
1739
- "tests::foo_test",
1740
- ),
1747
+ NavigationTarget {
1748
+ file_id: FileId(
1749
+ 0,
1750
+ ),
1751
+ full_range: 121..185,
1752
+ focus_range: 136..145,
1753
+ name: "foo2_test",
1754
+ kind: Function,
1755
+ },
1756
+ NavigationTarget {
1757
+ file_id: FileId(
1758
+ 0,
1759
+ ),
1760
+ full_range: 52..115,
1761
+ focus_range: 67..75,
1762
+ name: "foo_test",
1763
+ kind: Function,
1764
+ },
1741
1765
]
1742
1766
"# ] ] ,
1743
1767
) ;
You can’t perform that action at this time.
0 commit comments