aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-12-21 15:53:00 +0000
committerAleksey Kladov <[email protected]>2018-12-21 15:53:00 +0000
commit9de3a45be6a33e8cc2d7ef86ef0adcbaa0567cf5 (patch)
tree26c729a7393870a0fb40c1dd6f1bfc9af0690aa0 /crates
parenta5987bd715e96f3649841c1e2020fc972134bd11 (diff)
add tests for pd
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_analysis/src/completion/reference_completion.rs15
1 files changed, 13 insertions, 2 deletions
diff --git a/crates/ra_analysis/src/completion/reference_completion.rs b/crates/ra_analysis/src/completion/reference_completion.rs
index c2a650b6d..c2ac95453 100644
--- a/crates/ra_analysis/src/completion/reference_completion.rs
+++ b/crates/ra_analysis/src/completion/reference_completion.rs
@@ -599,7 +599,18 @@ mod tests {
599 } 599 }
600 600
601 #[test] 601 #[test]
602 fn test_item_snippets() { 602 fn completes_snippets_in_expressions() {
603 check_snippet_completion(
604 r"fn foo(x: i32) { <|> }",
605 r##"
606 pd "eprintln!(\"$0 = {:?}\", $0);"
607 ppd "eprintln!(\"$0 = {:#?}\", $0);"
608 "##,
609 );
610 }
611
612 #[test]
613 fn completes_snippets_in_items() {
603 // check_snippet_completion(r" 614 // check_snippet_completion(r"
604 // <|> 615 // <|>
605 // ", 616 // ",
@@ -615,7 +626,7 @@ mod tests {
615 r##" 626 r##"
616 tfn "Test function" "#[test]\nfn ${1:feature}() {\n $0\n}" 627 tfn "Test function" "#[test]\nfn ${1:feature}() {\n $0\n}"
617 pub(crate) "pub(crate) $0" 628 pub(crate) "pub(crate) $0"
618 "##, 629 "##,
619 ); 630 );
620 } 631 }
621 632