From 9de3a45be6a33e8cc2d7ef86ef0adcbaa0567cf5 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 21 Dec 2018 18:53:00 +0300 Subject: add tests for pd --- crates/ra_analysis/src/completion/reference_completion.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'crates') 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 { } #[test] - fn test_item_snippets() { + fn completes_snippets_in_expressions() { + check_snippet_completion( + r"fn foo(x: i32) { <|> }", + r##" + pd "eprintln!(\"$0 = {:?}\", $0);" + ppd "eprintln!(\"$0 = {:#?}\", $0);" + "##, + ); + } + + #[test] + fn completes_snippets_in_items() { // check_snippet_completion(r" // <|> // ", @@ -615,7 +626,7 @@ mod tests { r##" tfn "Test function" "#[test]\nfn ${1:feature}() {\n $0\n}" pub(crate) "pub(crate) $0" - "##, + "##, ); } -- cgit v1.2.3