1 use racer_testutils::*; 2 3 #[test] completes_methods_for_consts()4fn completes_methods_for_consts() { 5 let src = r#" 6 const FILE: &'static str = "main.rs"; 7 fn main() { 8 FILE.chars~ 9 } 10 "#; 11 assert_eq!(get_only_completion(src, None).matchstr, "chars"); 12 } 13 14 #[test] completes_methods_for_const_array()15fn completes_methods_for_const_array() { 16 let src = r#" 17 const VECTOR: [f64; 2] = [0.0, 0.0]; 18 fn main() { 19 VECTOR[0].atan2~ 20 } 21 "#; 22 assert_eq!(get_only_completion(src, None).matchstr, "atan2"); 23 } 24 25 #[test] completes_methods_for_static()26fn completes_methods_for_static() { 27 let src = r#" 28 static FILE: &'static str = "main.rs"; 29 fn main() { 30 FILE.chars~ 31 } 32 "#; 33 assert_eq!(get_only_completion(src, None).matchstr, "chars"); 34 } 35