Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-completion/src/tests/expression.rs')
| -rw-r--r-- | crates/ide-completion/src/tests/expression.rs | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/crates/ide-completion/src/tests/expression.rs b/crates/ide-completion/src/tests/expression.rs index d5137949d4..e5467767d4 100644 --- a/crates/ide-completion/src/tests/expression.rs +++ b/crates/ide-completion/src/tests/expression.rs @@ -2126,3 +2126,70 @@ fn main() { "#]], ); } + +#[test] +fn call_parens_with_newline() { + check_edit( + "foo", + r#" +fn foo(v: i32) {} + +fn bar() { + foo$0 + () +} + "#, + r#" +fn foo(v: i32) {} + +fn bar() { + foo(${1:v});$0 + () +} + "#, + ); + check_edit( + "foo", + r#" +struct Foo; +impl Foo { + fn foo(&self, v: i32) {} +} + +fn bar() { + Foo.foo$0 + () +} + "#, + r#" +struct Foo; +impl Foo { + fn foo(&self, v: i32) {} +} + +fn bar() { + Foo.foo(${1:v});$0 + () +} + "#, + ); +} + +#[test] +fn dbg_too_many_asterisks() { + check_edit( + "dbg", + r#" +fn main() { + let x = &42; + let y = *x.$0; +} + "#, + r#" +fn main() { + let x = &42; + let y = dbg!(*x); +} + "#, + ); +} |