Skip to content

Commit

Permalink
Fix 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, so I modified tests.
  • Loading branch information
kngwyu committed May 3, 2018
1 parent 54ceea8 commit 6df7414
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 @@ -3321,25 +3321,24 @@ fn closure_test_multiple_curly_brackets_in_args() {
fn literal_string_method() {
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]
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 6df7414

Please sign in to comment.