diff options
author | Yoshua Wuyts <[email protected]> | 2021-02-05 00:57:39 +0000 |
---|---|---|
committer | Yoshua Wuyts <[email protected]> | 2021-02-05 10:28:11 +0000 |
commit | 13d663dd16430cec18d7eccd214c3d4891b1a9a1 (patch) | |
tree | 626b5048ded809a840b215e413f37f19388bc9f9 /crates/assists/src/tests | |
parent | 842033b15055eba9aabfc730468cd076a30a5f29 (diff) |
add `generate-enum-match` assist
Diffstat (limited to 'crates/assists/src/tests')
-rw-r--r-- | crates/assists/src/tests/generated.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/crates/assists/src/tests/generated.rs b/crates/assists/src/tests/generated.rs index 9aa807f10..ae7b400e2 100644 --- a/crates/assists/src/tests/generated.rs +++ b/crates/assists/src/tests/generated.rs | |||
@@ -433,6 +433,33 @@ struct Point { | |||
433 | } | 433 | } |
434 | 434 | ||
435 | #[test] | 435 | #[test] |
436 | fn doctest_generate_enum_match_method() { | ||
437 | check_doc_test( | ||
438 | "generate_enum_match_method", | ||
439 | r#####" | ||
440 | enum Version { | ||
441 | Undefined, | ||
442 | Minor$0, | ||
443 | Major, | ||
444 | } | ||
445 | "#####, | ||
446 | r#####" | ||
447 | enum Version { | ||
448 | Undefined, | ||
449 | Minor, | ||
450 | Major, | ||
451 | } | ||
452 | |||
453 | impl Version { | ||
454 | fn is_minor(&self) -> bool { | ||
455 | matches!(self, Self::Minor) | ||
456 | } | ||
457 | } | ||
458 | "#####, | ||
459 | ) | ||
460 | } | ||
461 | |||
462 | #[test] | ||
436 | fn doctest_generate_from_impl_for_enum() { | 463 | fn doctest_generate_from_impl_for_enum() { |
437 | check_doc_test( | 464 | check_doc_test( |
438 | "generate_from_impl_for_enum", | 465 | "generate_from_impl_for_enum", |