fix CI: generate doctest
This commit is contained in:
parent
a7fada4650
commit
3605bb38ff
@ -2,7 +2,7 @@ use syntax::ast::{self, AstNode};
|
|||||||
|
|
||||||
use crate::{AssistContext, AssistId, AssistKind, Assists};
|
use crate::{AssistContext, AssistId, AssistKind, Assists};
|
||||||
|
|
||||||
// Assist: replace_is_some_with_if_let
|
// Assist: replace_is_some_with_if_let_some
|
||||||
//
|
//
|
||||||
// Replace `if x.is_some()` with `if let Some(_tmp) = x`.
|
// Replace `if x.is_some()` with `if let Some(_tmp) = x`.
|
||||||
//
|
//
|
||||||
@ -57,7 +57,7 @@ mod tests {
|
|||||||
use super::replace_is_some_with_if_let_some;
|
use super::replace_is_some_with_if_let_some;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn replace_is_some_with_if_let_works() {
|
fn replace_is_some_with_if_let_some_works() {
|
||||||
check_assist(
|
check_assist(
|
||||||
replace_is_some_with_if_let_some,
|
replace_is_some_with_if_let_some,
|
||||||
r#"
|
r#"
|
||||||
@ -76,7 +76,7 @@ fn main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn replace_is_some_with_if_let_not_applicable() {
|
fn replace_is_some_with_if_let_some_not_applicable() {
|
||||||
check_assist_not_applicable(
|
check_assist_not_applicable(
|
||||||
replace_is_some_with_if_let_some,
|
replace_is_some_with_if_let_some,
|
||||||
r#"
|
r#"
|
||||||
|
@ -2558,6 +2558,25 @@ fn handle(action: Action) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn doctest_replace_is_some_with_if_let_some() {
|
||||||
|
check_doc_test(
|
||||||
|
"replace_is_some_with_if_let_some",
|
||||||
|
r#####"
|
||||||
|
fn main() {
|
||||||
|
let x = Some(1);
|
||||||
|
if x.is_som$0e() {}
|
||||||
|
}
|
||||||
|
"#####,
|
||||||
|
r#####"
|
||||||
|
fn main() {
|
||||||
|
let x = Some(1);
|
||||||
|
if let Some(_tmp) = x {}
|
||||||
|
}
|
||||||
|
"#####,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn doctest_replace_let_with_if_let() {
|
fn doctest_replace_let_with_if_let() {
|
||||||
check_doc_test(
|
check_doc_test(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user