Skip to content

Commit

Permalink
Update tests for custom classes
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Sep 19, 2023
1 parent 6bed1c6 commit 295ec09
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 41 deletions.
8 changes: 3 additions & 5 deletions tests/rustdoc-ui/custom_code_classes_in_docs-warning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,25 +57,23 @@ pub fn foo8() {}
/// ```{class=one=two}
/// main;
/// ```
//~^^^ ERROR unexpected `=`
//~^^^ ERROR unexpected `=` character
pub fn foo9() {}

/// ```{.one.two}
/// main;
/// ```
//~^^^ ERROR unexpected `.` character
pub fn foo10() {}

/// ```{class=.one}
/// ```{class=(one}
/// main;
/// ```
//~^^^ ERROR unexpected `.` character after `=`
//~^^^ ERROR unexpected `(` character after `=`
pub fn foo11() {}

/// ```{class=one.two}
/// main;
/// ```
//~^^^ ERROR unexpected `.` character
pub fn foo12() {}

/// ```{(comment)}
Expand Down
26 changes: 5 additions & 21 deletions tests/rustdoc-ui/custom_code_classes_in_docs-warning.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -77,37 +77,21 @@ LL | | /// main;
LL | | /// ```
| |_______^

error: unexpected `.` character
--> $DIR/custom_code_classes_in_docs-warning.rs:63:1
error: unexpected `(` character after `=`
--> $DIR/custom_code_classes_in_docs-warning.rs:68:1
|
LL | / /// ```{.one.two}
LL | | /// main;
LL | | /// ```
| |_______^

error: unexpected `.` character after `=`
--> $DIR/custom_code_classes_in_docs-warning.rs:69:1
|
LL | / /// ```{class=.one}
LL | | /// main;
LL | | /// ```
| |_______^

error: unexpected `.` character
--> $DIR/custom_code_classes_in_docs-warning.rs:75:1
|
LL | / /// ```{class=one.two}
LL | / /// ```{class=(one}
LL | | /// main;
LL | | /// ```
| |_______^

error: unexpected character `(`
--> $DIR/custom_code_classes_in_docs-warning.rs:81:1
--> $DIR/custom_code_classes_in_docs-warning.rs:79:1
|
LL | / /// ```{(comment)}
LL | | /// main;
LL | | /// ```
| |_______^

error: aborting due to 13 previous errors
error: aborting due to 11 previous errors

3 changes: 0 additions & 3 deletions tests/rustdoc-ui/feature-gate-custom_code_classes_in_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,4 @@ pub struct Bar;
/// ```ASN.1
/// int main(void) { return 0; }
/// ```
//~^^^ WARNING custom classes in code blocks will change behaviour
//~| 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 Bar2;
13 changes: 1 addition & 12 deletions tests/rustdoc-ui/feature-gate-custom_code_classes_in_docs.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,5 @@ LL | | /// ```
= help: add `#![feature(custom_code_classes_in_docs)]` to the crate attributes to enable
= note: found these custom classes: class=language-c

warning: custom classes in code blocks will change behaviour
--> $DIR/feature-gate-custom_code_classes_in_docs.rs:12:1
|
LL | / /// ```ASN.1
LL | | /// int main(void) { return 0; }
LL | | /// ```
| |_______^
|
= note: see issue #79483 <https://github.com/rust-lang/rust/issues/79483> for more information
= help: add `#![feature(custom_code_classes_in_docs)]` to the crate attributes to enable

warning: 2 warnings emitted
warning: 1 warning emitted

0 comments on commit 295ec09

Please sign in to comment.