mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Update tests for custom_code_classes_in_docs
feature
This commit is contained in:
parent
e1294b26af
commit
c17abf124c
@ -49,7 +49,7 @@ fn test_unique_id() {
|
|||||||
fn test_lang_string_parse() {
|
fn test_lang_string_parse() {
|
||||||
fn t(lg: LangString) {
|
fn t(lg: LangString) {
|
||||||
let s = &lg.original;
|
let s = &lg.original;
|
||||||
assert_eq!(LangString::parse(s, ErrorCodes::Yes, true, None), lg)
|
assert_eq!(LangString::parse(s, ErrorCodes::Yes, true, None, true), lg)
|
||||||
}
|
}
|
||||||
|
|
||||||
t(Default::default());
|
t(Default::default());
|
||||||
@ -290,6 +290,7 @@ fn test_header() {
|
|||||||
edition: DEFAULT_EDITION,
|
edition: DEFAULT_EDITION,
|
||||||
playground: &None,
|
playground: &None,
|
||||||
heading_offset: HeadingOffset::H2,
|
heading_offset: HeadingOffset::H2,
|
||||||
|
custom_code_classes_in_docs: true,
|
||||||
}
|
}
|
||||||
.into_string();
|
.into_string();
|
||||||
assert_eq!(output, expect, "original: {}", input);
|
assert_eq!(output, expect, "original: {}", input);
|
||||||
@ -329,6 +330,7 @@ fn test_header_ids_multiple_blocks() {
|
|||||||
edition: DEFAULT_EDITION,
|
edition: DEFAULT_EDITION,
|
||||||
playground: &None,
|
playground: &None,
|
||||||
heading_offset: HeadingOffset::H2,
|
heading_offset: HeadingOffset::H2,
|
||||||
|
custom_code_classes_in_docs: true,
|
||||||
}
|
}
|
||||||
.into_string();
|
.into_string();
|
||||||
assert_eq!(output, expect, "original: {}", input);
|
assert_eq!(output, expect, "original: {}", input);
|
||||||
@ -433,7 +435,7 @@ fn test_find_testable_code_line() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
let mut lines = Vec::<usize>::new();
|
let mut lines = Vec::<usize>::new();
|
||||||
find_testable_code(input, &mut lines, ErrorCodes::No, false, None);
|
find_testable_code(input, &mut lines, ErrorCodes::No, false, None, true);
|
||||||
assert_eq!(lines, expect);
|
assert_eq!(lines, expect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -458,6 +460,7 @@ fn test_ascii_with_prepending_hashtag() {
|
|||||||
edition: DEFAULT_EDITION,
|
edition: DEFAULT_EDITION,
|
||||||
playground: &None,
|
playground: &None,
|
||||||
heading_offset: HeadingOffset::H2,
|
heading_offset: HeadingOffset::H2,
|
||||||
|
custom_code_classes_in_docs: true,
|
||||||
}
|
}
|
||||||
.into_string();
|
.into_string();
|
||||||
assert_eq!(output, expect, "original: {}", input);
|
assert_eq!(output, expect, "original: {}", input);
|
||||||
|
@ -1,5 +1,10 @@
|
|||||||
|
// check-pass
|
||||||
|
|
||||||
/// ```{class=language-c}
|
/// ```{class=language-c}
|
||||||
/// int main(void) { return 0; }
|
/// int main(void) { return 0; }
|
||||||
/// ```
|
/// ```
|
||||||
//~^^^ ERROR 1:1: 3:8: custom classes in code blocks are unstable [E0658]
|
//~^^^ WARNING custom classes in code blocks will change behaviour
|
||||||
|
//~| NOTE found these custom classes: class=language-c
|
||||||
|
//~| NOTE see issue #79483 <https://github.com/rust-lang/rust/issues/79483>
|
||||||
|
//~| HELP add `#![feature(custom_code_classes_in_docs)]` to the crate attributes to enable
|
||||||
pub struct Bar;
|
pub struct Bar;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
error[E0658]: custom classes in code blocks are unstable
|
warning: custom classes in code blocks will change behaviour
|
||||||
--> $DIR/feature-gate-custom_code_classes_in_docs.rs:1:1
|
--> $DIR/feature-gate-custom_code_classes_in_docs.rs:3:1
|
||||||
|
|
|
|
||||||
LL | / /// ```{class=language-c}
|
LL | / /// ```{class=language-c}
|
||||||
LL | | /// int main(void) { return 0; }
|
LL | | /// int main(void) { return 0; }
|
||||||
@ -10,6 +10,5 @@ LL | | /// ```
|
|||||||
= help: add `#![feature(custom_code_classes_in_docs)]` to the crate attributes to enable
|
= help: add `#![feature(custom_code_classes_in_docs)]` to the crate attributes to enable
|
||||||
= note: found these custom classes: class=language-c
|
= note: found these custom classes: class=language-c
|
||||||
|
|
||||||
error: aborting due to previous error
|
warning: 1 warning emitted
|
||||||
|
|
||||||
For more information about this error, try `rustc --explain E0658`.
|
|
||||||
|
Loading…
Reference in New Issue
Block a user