Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 59738d5

Browse files
committed
fix: add generated doctest
1 parent d7a8e80 commit 59738d5

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

crates/ide-assists/src/tests/generated.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,34 @@ fn some_function(x: i32) {
280280
)
281281
}
282282

283+
#[test]
284+
fn doctest_bool_to_enum() {
285+
check_doc_test(
286+
"bool_to_enum",
287+
r#####"
288+
fn main() {
289+
let $0bool = true;
290+
291+
if bool {
292+
println!("foo");
293+
}
294+
}
295+
"#####,
296+
r#####"
297+
fn main() {
298+
#[derive(PartialEq, Eq)]
299+
enum Bool { True, False }
300+
301+
let bool = Bool::True;
302+
303+
if bool == Bool::True {
304+
println!("foo");
305+
}
306+
}
307+
"#####,
308+
)
309+
}
310+
283311
#[test]
284312
fn doctest_change_visibility() {
285313
check_doc_test(

0 commit comments

Comments
 (0)