From eea431180eb5267928c8e0d4b8099ab1042e01d1 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 6 May 2020 10:21:35 +0200 Subject: Regenerate --- crates/ra_assists/src/tests.rs | 2 + crates/ra_assists/src/tests/generated.rs | 76 ++++++++++++++++---------------- xtask/src/codegen.rs | 2 +- xtask/src/codegen/gen_assists_docs.rs | 4 +- xtask/tests/tidy-tests/main.rs | 2 +- 5 files changed, 44 insertions(+), 42 deletions(-) diff --git a/crates/ra_assists/src/tests.rs b/crates/ra_assists/src/tests.rs index 97744904a..483e11931 100644 --- a/crates/ra_assists/src/tests.rs +++ b/crates/ra_assists/src/tests.rs @@ -1,3 +1,5 @@ +mod generated; + use std::sync::Arc; use hir::Semantics; diff --git a/crates/ra_assists/src/tests/generated.rs b/crates/ra_assists/src/tests/generated.rs index 6696cc832..7d35fa284 100644 --- a/crates/ra_assists/src/tests/generated.rs +++ b/crates/ra_assists/src/tests/generated.rs @@ -1,10 +1,10 @@ //! Generated file, do not edit by hand, see `xtask/src/codegen` -use super::check; +use super::check_doc_test; #[test] fn doctest_add_custom_impl() { - check( + check_doc_test( "add_custom_impl", r#####" #[derive(Deb<|>ug, Display)] @@ -23,7 +23,7 @@ impl Debug for S { #[test] fn doctest_add_derive() { - check( + check_doc_test( "add_derive", r#####" struct Point { @@ -43,7 +43,7 @@ struct Point { #[test] fn doctest_add_explicit_type() { - check( + check_doc_test( "add_explicit_type", r#####" fn main() { @@ -60,7 +60,7 @@ fn main() { #[test] fn doctest_add_function() { - check( + check_doc_test( "add_function", r#####" struct Baz; @@ -87,7 +87,7 @@ fn bar(arg: &str, baz: Baz) { #[test] fn doctest_add_hash() { - check( + check_doc_test( "add_hash", r#####" fn main() { @@ -104,7 +104,7 @@ fn main() { #[test] fn doctest_add_impl() { - check( + check_doc_test( "add_impl", r#####" struct Ctx { @@ -125,7 +125,7 @@ impl Ctx { #[test] fn doctest_add_impl_default_members() { - check( + check_doc_test( "add_impl_default_members", r#####" trait Trait { @@ -159,7 +159,7 @@ impl Trait for () { #[test] fn doctest_add_impl_missing_members() { - check( + check_doc_test( "add_impl_missing_members", r#####" trait Trait { @@ -191,7 +191,7 @@ impl Trait for () { #[test] fn doctest_add_new() { - check( + check_doc_test( "add_new", r#####" struct Ctx { @@ -213,7 +213,7 @@ impl Ctx { #[test] fn doctest_apply_demorgan() { - check( + check_doc_test( "apply_demorgan", r#####" fn main() { @@ -230,7 +230,7 @@ fn main() { #[test] fn doctest_auto_import() { - check( + check_doc_test( "auto_import", r#####" fn main() { @@ -251,7 +251,7 @@ pub mod std { pub mod collections { pub struct HashMap { } } } #[test] fn doctest_change_visibility() { - check( + check_doc_test( "change_visibility", r#####" <|>fn frobnicate() {} @@ -264,7 +264,7 @@ pub(crate) fn frobnicate() {} #[test] fn doctest_convert_to_guarded_return() { - check( + check_doc_test( "convert_to_guarded_return", r#####" fn main() { @@ -288,7 +288,7 @@ fn main() { #[test] fn doctest_fill_match_arms() { - check( + check_doc_test( "fill_match_arms", r#####" enum Action { Move { distance: u32 }, Stop } @@ -314,7 +314,7 @@ fn handle(action: Action) { #[test] fn doctest_flip_binexpr() { - check( + check_doc_test( "flip_binexpr", r#####" fn main() { @@ -331,7 +331,7 @@ fn main() { #[test] fn doctest_flip_comma() { - check( + check_doc_test( "flip_comma", r#####" fn main() { @@ -348,7 +348,7 @@ fn main() { #[test] fn doctest_flip_trait_bound() { - check( + check_doc_test( "flip_trait_bound", r#####" fn foo Copy>() { } @@ -361,7 +361,7 @@ fn foo() { } #[test] fn doctest_inline_local_variable() { - check( + check_doc_test( "inline_local_variable", r#####" fn main() { @@ -379,7 +379,7 @@ fn main() { #[test] fn doctest_introduce_variable() { - check( + check_doc_test( "introduce_variable", r#####" fn main() { @@ -397,7 +397,7 @@ fn main() { #[test] fn doctest_invert_if() { - check( + check_doc_test( "invert_if", r#####" fn main() { @@ -414,7 +414,7 @@ fn main() { #[test] fn doctest_make_raw_string() { - check( + check_doc_test( "make_raw_string", r#####" fn main() { @@ -431,7 +431,7 @@ fn main() { #[test] fn doctest_make_usual_string() { - check( + check_doc_test( "make_usual_string", r#####" fn main() { @@ -448,7 +448,7 @@ fn main() { #[test] fn doctest_merge_imports() { - check( + check_doc_test( "merge_imports", r#####" use std::<|>fmt::Formatter; @@ -462,7 +462,7 @@ use std::{fmt::Formatter, io}; #[test] fn doctest_merge_match_arms() { - check( + check_doc_test( "merge_match_arms", r#####" enum Action { Move { distance: u32 }, Stop } @@ -488,7 +488,7 @@ fn handle(action: Action) { #[test] fn doctest_move_arm_cond_to_match_guard() { - check( + check_doc_test( "move_arm_cond_to_match_guard", r#####" enum Action { Move { distance: u32 }, Stop } @@ -515,7 +515,7 @@ fn handle(action: Action) { #[test] fn doctest_move_bounds_to_where_clause() { - check( + check_doc_test( "move_bounds_to_where_clause", r#####" fn applyF: FnOnce(T) -> U>(f: F, x: T) -> U { @@ -532,7 +532,7 @@ fn apply(f: F, x: T) -> U where F: FnOnce(T) -> U { #[test] fn doctest_move_guard_to_arm_body() { - check( + check_doc_test( "move_guard_to_arm_body", r#####" enum Action { Move { distance: u32 }, Stop } @@ -559,7 +559,7 @@ fn handle(action: Action) { #[test] fn doctest_remove_dbg() { - check( + check_doc_test( "remove_dbg", r#####" fn main() { @@ -576,7 +576,7 @@ fn main() { #[test] fn doctest_remove_hash() { - check( + check_doc_test( "remove_hash", r#####" fn main() { @@ -593,7 +593,7 @@ fn main() { #[test] fn doctest_remove_mut() { - check( + check_doc_test( "remove_mut", r#####" impl Walrus { @@ -610,7 +610,7 @@ impl Walrus { #[test] fn doctest_reorder_fields() { - check( + check_doc_test( "reorder_fields", r#####" struct Foo {foo: i32, bar: i32}; @@ -625,7 +625,7 @@ const test: Foo = Foo {foo: 1, bar: 0} #[test] fn doctest_replace_if_let_with_match() { - check( + check_doc_test( "replace_if_let_with_match", r#####" enum Action { Move { distance: u32 }, Stop } @@ -653,7 +653,7 @@ fn handle(action: Action) { #[test] fn doctest_replace_let_with_if_let() { - check( + check_doc_test( "replace_let_with_if_let", r#####" enum Option { Some(T), None } @@ -679,7 +679,7 @@ fn compute() -> Option { None } #[test] fn doctest_replace_qualified_name_with_use() { - check( + check_doc_test( "replace_qualified_name_with_use", r#####" fn process(map: std::collections::<|>HashMap) {} @@ -694,7 +694,7 @@ fn process(map: HashMap) {} #[test] fn doctest_replace_unwrap_with_match() { - check( + check_doc_test( "replace_unwrap_with_match", r#####" enum Result { Ok(T), Err(E) } @@ -718,7 +718,7 @@ fn main() { #[test] fn doctest_split_import() { - check( + check_doc_test( "split_import", r#####" use std::<|>collections::HashMap; @@ -731,7 +731,7 @@ use std::{collections::HashMap}; #[test] fn doctest_unwrap_block() { - check( + check_doc_test( "unwrap_block", r#####" fn foo() { diff --git a/xtask/src/codegen.rs b/xtask/src/codegen.rs index 0e4dcb95a..b4907f4b2 100644 --- a/xtask/src/codegen.rs +++ b/xtask/src/codegen.rs @@ -27,7 +27,7 @@ const AST_NODES: &str = "crates/ra_syntax/src/ast/generated/nodes.rs"; const AST_TOKENS: &str = "crates/ra_syntax/src/ast/generated/tokens.rs"; const ASSISTS_DIR: &str = "crates/ra_assists/src/handlers"; -const ASSISTS_TESTS: &str = "crates/ra_assists/src/doc_tests/generated.rs"; +const ASSISTS_TESTS: &str = "crates/ra_assists/src/tests/generated.rs"; const ASSISTS_DOCS: &str = "docs/user/assists.md"; #[derive(Debug, PartialEq, Eq, Clone, Copy)] diff --git a/xtask/src/codegen/gen_assists_docs.rs b/xtask/src/codegen/gen_assists_docs.rs index 31d606535..4bd6b5f0c 100644 --- a/xtask/src/codegen/gen_assists_docs.rs +++ b/xtask/src/codegen/gen_assists_docs.rs @@ -101,14 +101,14 @@ fn collect_assists() -> Result> { } fn generate_tests(assists: &[Assist], mode: Mode) -> Result<()> { - let mut buf = String::from("use super::check;\n"); + let mut buf = String::from("use super::check_doc_test;\n"); for assist in assists.iter() { let test = format!( r######" #[test] fn doctest_{}() {{ - check( + check_doc_test( "{}", r#####" {}"#####, r#####" diff --git a/xtask/tests/tidy-tests/main.rs b/xtask/tests/tidy-tests/main.rs index 3213c4dfa..a3c2e37d1 100644 --- a/xtask/tests/tidy-tests/main.rs +++ b/xtask/tests/tidy-tests/main.rs @@ -24,7 +24,7 @@ fn check_todo(path: &Path, text: &str) { // This file itself is whitelisted since this test itself contains matches. "tests/cli.rs", // Some of our assists generate `todo!()` so those files are whitelisted. - "doc_tests/generated.rs", + "tests/generated.rs", "handlers/add_missing_impl_members.rs", "handlers/add_function.rs", // To support generating `todo!()` in assists, we have `expr_todo()` in ast::make. -- cgit v1.2.3