aboutsummaryrefslogtreecommitdiff
path: root/crates/assists/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'crates/assists/src/tests')
-rw-r--r--crates/assists/src/tests/generated.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/crates/assists/src/tests/generated.rs b/crates/assists/src/tests/generated.rs
index 9aa807f10..e84f208a3 100644
--- a/crates/assists/src/tests/generated.rs
+++ b/crates/assists/src/tests/generated.rs
@@ -257,6 +257,33 @@ fn qux(bar: Bar, baz: Baz) {}
257} 257}
258 258
259#[test] 259#[test]
260fn doctest_extract_function() {
261 check_doc_test(
262 "extract_function",
263 r#####"
264fn main() {
265 let n = 1;
266 $0let m = n + 2;
267 let k = m + n;$0
268 let g = 3;
269}
270"#####,
271 r#####"
272fn main() {
273 let n = 1;
274 fun_name(n);
275 let g = 3;
276}
277
278fn $0fun_name(n: i32) {
279 let m = n + 2;
280 let k = m + n;
281}
282"#####,
283 )
284}
285
286#[test]
260fn doctest_extract_struct_from_enum_variant() { 287fn doctest_extract_struct_from_enum_variant() {
261 check_doc_test( 288 check_doc_test(
262 "extract_struct_from_enum_variant", 289 "extract_struct_from_enum_variant",