Skip to content

Commit cafc7e3

Browse files
committed
Fix doc test
1 parent 3edc25d commit cafc7e3

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

crates/ide_assists/src/handlers/promote_mod_file.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ use crate::assist_context::{AssistContext, Assists};
1414
// Moves inline module's contents to a separate file.
1515
//
1616
// ```
17-
// // a.rs
17+
// //- /main.rs
18+
// mod a;
19+
// //- /a.rs
1820
// $0fn t() {}
1921
// ```
2022
// ->
2123
// ```
22-
// // /a/mod.rs
2324
// fn t() {}
2425
// ```
2526
pub(crate) fn promote_mod_file(acc: &mut Assists, ctx: &AssistContext) -> Option<()> {

crates/ide_assists/src/tests/generated.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,22 @@ mod foo;
12261226
)
12271227
}
12281228

1229+
#[test]
1230+
fn doctest_promote_mod_file() {
1231+
check_doc_test(
1232+
"promote_mod_file",
1233+
r#####"
1234+
//- /main.rs
1235+
mod a;
1236+
//- /a.rs
1237+
$0fn t() {}
1238+
"#####,
1239+
r#####"
1240+
fn t() {}
1241+
"#####,
1242+
)
1243+
}
1244+
12291245
#[test]
12301246
fn doctest_pull_assignment_up() {
12311247
check_doc_test(

0 commit comments

Comments
 (0)