Skip to content

Commit

Permalink
Modify broken tests for string literals
Browse files Browse the repository at this point in the history
Now by rust-lang/rust#49896 some string
methods like `starts_with` or `as_bytes` are declared in the macro
str_core_methods and racer can't complete these methods.
  • Loading branch information
kngwyu committed May 11, 2018
1 parent ab5d67c commit b80d1cc
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tests/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3692,12 +3692,12 @@ fn literal_string_method() {
let _lock = sync!();
let src = r#"
fn check() {
"hello".st~arts_with("he");
"hello".to_lowerca~se();
}
"#;

let got = get_definition(src, None);
assert_eq!("starts_with", got.matchstr);
assert_eq!("to_lowercase", got.matchstr);
}

#[test]
Expand All @@ -3706,13 +3706,12 @@ fn literal_string_completes() {
let src = r#"
fn in_let() {
let foo = "hello";
foo.end~s_with("lo");
foo.to_lowerc~
}
"#;

let got = get_all_completions(src, None);
assert_eq!(1, got.len());
assert_eq!("ends_with", got[0].matchstr);
let got = get_only_completion(src, None);
assert_eq!("to_lowercase", got.matchstr);
}

#[test]
Expand Down

0 comments on commit b80d1cc

Please sign in to comment.