This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +26
-8
lines changed Expand file tree Collapse file tree 4 files changed +26
-8
lines changed Original file line number Diff line number Diff line change @@ -288,7 +288,6 @@ run-make/static-unwinding/Makefile
288288run-make/staticlib-blank-lib/Makefile
289289run-make/staticlib-dylib-linkage/Makefile
290290run-make/std-core-cycle/Makefile
291- run-make/stdin-non-utf8/Makefile
292291run-make/suspicious-library/Makefile
293292run-make/symbol-mangling-hashed/Makefile
294293run-make/symbol-visibility/Makefile
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ //! This test checks rustc `-` (stdin) support
2+
3+ use run_make_support:: { is_windows, rustc, tmp_dir} ;
4+
5+ const HELLO_WORLD : & str = r#"
6+ fn main() {
7+ println!("Hello world!");
8+ }
9+ "# ;
10+
11+ const NOT_UTF8 : & [ u8 ] = & [ 0xff , 0xff , 0xff ] ;
12+
13+ fn main ( ) {
14+ let out_dir = tmp_dir ( ) ;
15+
16+ // echo $HELLO_WORLD | rustc -
17+ rustc ( ) . arg ( "-" ) . stdin ( HELLO_WORLD ) . run ( ) ;
18+ assert ! (
19+ out_dir. join( if !is_windows( ) { "rust_out" } else { "rust_out.exe" } ) . try_exists( ) . unwrap( )
20+ ) ;
21+
22+ // echo $NOT_UTF8 | rustc -
23+ let output = rustc ( ) . arg ( "-" ) . stdin ( NOT_UTF8 ) . run_fail ( ) ;
24+ let stderr = String :: from_utf8 ( output. stderr ) . unwrap ( ) ;
25+ assert ! ( stderr. contains( "error: couldn't read from stdin, as it did not contain valid UTF-8" ) ) ;
26+ }
You can’t perform that action at this time.
0 commit comments