Skip to content

Commit 5392d56

Browse files
committed
Update generated doctests
Update generated doctests, change unit test to be different to doctest.
1 parent ce3ca99 commit 5392d56

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

src/tools/rust-analyzer/crates/ide-assists/src/handlers/explicit_enum_discriminant.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,8 @@ enum TheEnum$0 {
100100
Bar,
101101
Baz = 42,
102102
Quux,
103+
FooBar = -5,
104+
FooBaz,
103105
}
104106
"#,
105107
r#"
@@ -108,6 +110,8 @@ enum TheEnum {
108110
Bar = 1,
109111
Baz = 42,
110112
Quux = 43,
113+
FooBar = -5,
114+
FooBaz = -4,
111115
}
112116
"#,
113117
);

src/tools/rust-analyzer/crates/ide-assists/src/tests/generated.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -909,6 +909,29 @@ fn qux(bar: Bar, baz: Baz) {}
909909
)
910910
}
911911

912+
#[test]
913+
fn doctest_explicit_enum_discriminant() {
914+
check_doc_test(
915+
"explicit_enum_discriminant",
916+
r#####"
917+
enum TheEnum$0 {
918+
Foo,
919+
Bar,
920+
Baz = 42,
921+
Quux,
922+
}
923+
"#####,
924+
r#####"
925+
enum TheEnum {
926+
Foo = 0,
927+
Bar = 1,
928+
Baz = 42,
929+
Quux = 43,
930+
}
931+
"#####,
932+
)
933+
}
934+
912935
#[test]
913936
fn doctest_extract_expressions_from_format_string() {
914937
check_doc_test(

0 commit comments

Comments
 (0)