@@ -2052,15 +2052,29 @@ pub mod test {
2052
2052
assert_eq ! ( expected, actual) ;
2053
2053
}
2054
2054
2055
+ enum Racer {
2056
+ Yes ,
2057
+ No ,
2058
+ }
2059
+
2060
+ impl Into < bool > for Racer {
2061
+ fn into ( self ) -> bool {
2062
+ match self {
2063
+ Racer :: Yes => true ,
2064
+ Racer :: No => false ,
2065
+ }
2066
+ }
2067
+ }
2068
+
2055
2069
// Common logic used in `test_tooltip_*` tests below
2056
- fn run_tooltip_tests ( tests : & [ Test ] , proj_dir : PathBuf , racer_completion : bool ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
2070
+ fn run_tooltip_tests ( tests : & [ Test ] , proj_dir : PathBuf , racer_completion : Racer ) -> Result < ( ) , Box < dyn std:: error:: Error > > {
2057
2071
let out = LineOutput :: default ( ) ;
2058
2072
2059
2073
let save_dir_guard = tempfile:: tempdir ( ) . unwrap ( ) ;
2060
2074
let save_dir = save_dir_guard. path ( ) . to_owned ( ) ;
2061
2075
let load_dir = proj_dir. join ( "save_data" ) ;
2062
2076
2063
- let harness = TooltipTestHarness :: new ( proj_dir, & out, racer_completion) ;
2077
+ let harness = TooltipTestHarness :: new ( proj_dir, & out, racer_completion. into ( ) ) ;
2064
2078
2065
2079
out. reset ( ) ;
2066
2080
@@ -2127,7 +2141,7 @@ pub mod test {
2127
2141
Test :: new( "test_tooltip_mod_use.rs" , 13 , 28 ) ,
2128
2142
] ;
2129
2143
2130
- run_tooltip_tests ( & tests, FIXTURES_DIR . join ( "hover" ) , false )
2144
+ run_tooltip_tests ( & tests, FIXTURES_DIR . join ( "hover" ) , Racer :: No )
2131
2145
}
2132
2146
2133
2147
#[ test]
@@ -2142,7 +2156,7 @@ pub mod test {
2142
2156
Test :: new( "test_tooltip_mod_use_external.rs" , 12 , 12 ) ,
2143
2157
] ;
2144
2158
2145
- run_tooltip_tests ( & tests, FIXTURES_DIR . join ( "hover" ) , true )
2159
+ run_tooltip_tests ( & tests, FIXTURES_DIR . join ( "hover" ) , Racer :: Yes )
2146
2160
}
2147
2161
2148
2162
/// Note: This test is ignored as it doesn't work in the rust-lang/rust repo.
@@ -2169,7 +2183,7 @@ pub mod test {
2169
2183
Test :: new( "test_tooltip_std.rs" , 25 , 25 ) ,
2170
2184
] ;
2171
2185
2172
- run_tooltip_tests ( & tests, FIXTURES_DIR . join ( "hover" ) , false )
2186
+ run_tooltip_tests ( & tests, FIXTURES_DIR . join ( "hover" ) , Racer :: No )
2173
2187
}
2174
2188
2175
2189
/// Note: This test is ignored as it doesn't work in the rust-lang/rust repo.
@@ -2186,6 +2200,6 @@ pub mod test {
2186
2200
Test :: new( "test_tooltip_mod_use_external.rs" , 15 , 12 ) ,
2187
2201
] ;
2188
2202
2189
- run_tooltip_tests ( & tests, FIXTURES_DIR . join ( "hover" ) , true )
2203
+ run_tooltip_tests ( & tests, FIXTURES_DIR . join ( "hover" ) , Racer :: Yes )
2190
2204
}
2191
2205
}
0 commit comments