Skip to content

Commit

Permalink
Add tests for --output-to-stdout option
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Aug 11, 2024
1 parent 668e323 commit 3868ad5
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/rustdoc-ui/json-stdout-2.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Checks that the `--output-to-stdout` option prints to stdout.

//@ compile-flags: -Zunstable-options --output-to-stdout --output-format=json
//@ check-pass

#![no_std]

pub struct Foo;
4 changes: 4 additions & 0 deletions tests/rustdoc-ui/json-stdout-2.stdout

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions tests/rustdoc-ui/json-stdout-3.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Checks that the `--output-to-stdout` option is unstable.

//@ compile-flags: --output-format=json --output-to-stdout

pub struct Foo;
2 changes: 2 additions & 0 deletions tests/rustdoc-ui/json-stdout-3.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
error: the `-Z unstable-options` flag must also be passed to enable the flag `output-to-stdout`

5 changes: 5 additions & 0 deletions tests/rustdoc-ui/json-stdout.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Checks that the `--output-to-stdout` option is unstable.

//@ compile-flags: --output-format=json --output-to-stdout

pub struct Foo;
2 changes: 2 additions & 0 deletions tests/rustdoc-ui/json-stdout.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
error: the `-Z unstable-options` flag must also be passed to enable the flag `output-to-stdout`

0 comments on commit 3868ad5

Please sign in to comment.