mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
fix: add generated doctest
This commit is contained in:
parent
d7a8e800c9
commit
59738d5fd5
@ -280,6 +280,34 @@ fn some_function(x: i32) {
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn doctest_bool_to_enum() {
|
||||
check_doc_test(
|
||||
"bool_to_enum",
|
||||
r#####"
|
||||
fn main() {
|
||||
let $0bool = true;
|
||||
|
||||
if bool {
|
||||
println!("foo");
|
||||
}
|
||||
}
|
||||
"#####,
|
||||
r#####"
|
||||
fn main() {
|
||||
#[derive(PartialEq, Eq)]
|
||||
enum Bool { True, False }
|
||||
|
||||
let bool = Bool::True;
|
||||
|
||||
if bool == Bool::True {
|
||||
println!("foo");
|
||||
}
|
||||
}
|
||||
"#####,
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn doctest_change_visibility() {
|
||||
check_doc_test(
|
||||
|
Loading…
Reference in New Issue
Block a user