mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Merge #1176
1176: Add a simple test for str method completion r=flodiebold a=flodiebold Somehow I forgot that we should add a test for this in #1154 until after it was already merging. So I'll just add one now :) Co-authored-by: Florian Diebold <flodiebold@gmail.com>
This commit is contained in:
commit
e4a58ee1f4
1 changed files with 22 additions and 0 deletions
|
@ -626,6 +626,28 @@ fn test(a: A) {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn infer_inherent_method_str() {
|
||||
assert_snapshot_matches!(
|
||||
infer(r#"
|
||||
#[lang = "str"]
|
||||
impl str {
|
||||
fn foo(&self) -> i32 {}
|
||||
}
|
||||
|
||||
fn test() {
|
||||
"foo".foo();
|
||||
}
|
||||
"#),
|
||||
@r###"
|
||||
[40; 44) 'self': &str
|
||||
[53; 55) '{}': ()
|
||||
[69; 89) '{ ...o(); }': ()
|
||||
[75; 80) '"foo"': &str
|
||||
[75; 86) '"foo".foo()': i32"###
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn infer_tuple() {
|
||||
assert_snapshot_matches!(
|
||||
|
|
Loading…
Reference in a new issue