aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-04-07 17:25:47 +0100
committerAleksey Kladov <[email protected]>2020-04-07 17:25:47 +0100
commit7819d99d6bc617ee8653e9dc2fa4d82072d6c594 (patch)
tree13eecb6b4d76c758b5822bd4ef0573d37b943f7a /crates/ra_ide
parentd8f6013404a88d845cda6793162e7ac24b0ccbf2 (diff)
Add functional update test
Diffstat (limited to 'crates/ra_ide')
-rw-r--r--crates/ra_ide/src/completion/complete_record.rs33
1 files changed, 33 insertions, 0 deletions
diff --git a/crates/ra_ide/src/completion/complete_record.rs b/crates/ra_ide/src/completion/complete_record.rs
index b180e2388..2352ced5f 100644
--- a/crates/ra_ide/src/completion/complete_record.rs
+++ b/crates/ra_ide/src/completion/complete_record.rs
@@ -410,5 +410,38 @@ mod tests {
410 ] 410 ]
411 "###); 411 "###);
412 } 412 }
413
414 #[test]
415 fn completes_functional_update() {
416 let completions = complete(
417 r"
418 struct S {
419 foo1: u32,
420 foo2: u32,
421 }
422
423 fn main() {
424 let foo1 = 1;
425 let s = S {
426 foo1,
427 <|>
428 .. loop {}
429 }
430 }
431 ",
432 );
433 assert_debug_snapshot!(completions, @r###"
434 [
435 CompletionItem {
436 label: "foo2",
437 source_range: [221; 221),
438 delete: [221; 221),
439 insert: "foo2",
440 kind: Field,
441 detail: "u32",
442 },
443 ]
444 "###);
445 }
413 } 446 }
414} 447}