Skip to content

Commit 74ebb7b

Browse files
authored
Merge pull request #849 from kngwyu/fix-string-tests
Modify broken tests for string literals
2 parents ab5d67c + b80d1cc commit 74ebb7b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

tests/system.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3692,12 +3692,12 @@ fn literal_string_method() {
36923692
let _lock = sync!();
36933693
let src = r#"
36943694
fn check() {
3695-
"hello".st~arts_with("he");
3695+
"hello".to_lowerca~se();
36963696
}
36973697
"#;
36983698

36993699
let got = get_definition(src, None);
3700-
assert_eq!("starts_with", got.matchstr);
3700+
assert_eq!("to_lowercase", got.matchstr);
37013701
}
37023702

37033703
#[test]
@@ -3706,13 +3706,12 @@ fn literal_string_completes() {
37063706
let src = r#"
37073707
fn in_let() {
37083708
let foo = "hello";
3709-
foo.end~s_with("lo");
3709+
foo.to_lowerc~
37103710
}
37113711
"#;
37123712

3713-
let got = get_all_completions(src, None);
3714-
assert_eq!(1, got.len());
3715-
assert_eq!("ends_with", got[0].matchstr);
3713+
let got = get_only_completion(src, None);
3714+
assert_eq!("to_lowercase", got.matchstr);
37163715
}
37173716

37183717
#[test]

0 commit comments

Comments
 (0)