From a996b66cc65741d51270f4ebf97c5fc35e957f17 Mon Sep 17 00:00:00 2001 From: Yerkebulan Tulibergenov Date: Sun, 13 Jan 2019 17:59:56 -0800 Subject: add failing test test_introduce_var_block_expr_second_to_last --- .../ra_ide_api_light/src/assists/introduce_variable.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'crates') diff --git a/crates/ra_ide_api_light/src/assists/introduce_variable.rs b/crates/ra_ide_api_light/src/assists/introduce_variable.rs index 523ec7034..d5b7487e0 100644 --- a/crates/ra_ide_api_light/src/assists/introduce_variable.rs +++ b/crates/ra_ide_api_light/src/assists/introduce_variable.rs @@ -141,4 +141,21 @@ fn foo() { ); } + #[test] + fn test_introduce_var_block_expr_second_to_last() { + check_assist_range( + introduce_variable, + " +fn foo() { + <|>{ let x = 0; x }<|> + something_else(); +}", + " +fn foo() { + let <|>var_name = { let x = 0; x }; + var_name + something_else(); +}", + ); + } } -- cgit v1.2.3