test(rustdoc): depinfo cannot be emitted to stdout

This commit demonstrates that `rustdoc --emit=depinfo=-` hasn't yet
supported emitting to stdout.
This commit is contained in:
Weihang Lo 2025-10-15 23:14:15 -04:00
parent 235a4c083e
commit 0abea28107
No known key found for this signature in database
GPG key ID: D7DBF189825E82E7

View file

@ -45,4 +45,15 @@ fn main() {
assert!(!path("precedence1.d").exists());
assert!(!path("precedence2.d").exists());
assert!(path("precedence3.d").exists());
// stdout (-) also wins if being the last.
let result = rustdoc()
.input("lib.rs")
.arg("-Zunstable-options")
.emit("dep-info=precedence1.d")
.emit("dep-info=-")
.run();
assert!(!path("precedence1.d").exists());
assert!(path("-").exists()); // `-` be treated as a file path
assert!(result.stdout().is_empty()); // Nothing emitted to stdout
}