This commit is contained in:
Asuka Minato 2025-11-21 21:06:32 +09:00
parent 2f4ca9d599
commit 2dcbfefb03

View file

@ -754,6 +754,31 @@ fn foo() {
)
}
#[test]
fn doctest_convert_record_struct_to_unit_struct() {
check_doc_test(
"convert_record_struct_to_unit_struct",
r#####"
struct Foo$0 {}
impl Foo {
fn new() -> Self {
Foo {}
}
}
"#####,
r#####"
struct Foo;
impl Foo {
fn new() -> Self {
Foo
}
}
"#####,
)
}
#[test]
fn doctest_convert_to_guarded_return() {
check_doc_test(
@ -866,6 +891,31 @@ fn main() {
)
}
#[test]
fn doctest_convert_unit_struct_to_record_struct() {
check_doc_test(
"convert_unit_struct_to_record_struct",
r#####"
struct Foo$0;
impl Foo {
fn new() -> Self {
Foo
}
}
"#####,
r#####"
struct Foo {}
impl Foo {
fn new() -> Self {
Foo {}
}
}
"#####,
)
}
#[test]
fn doctest_convert_while_to_loop() {
check_doc_test(