File tree Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change 11//! Tests for displaying the cargo version.
22
3- #![ allow( deprecated) ]
4-
53use cargo_test_support:: { cargo_process, project} ;
64
75#[ cargo_test]
86fn simple ( ) {
97 let p = project ( ) . build ( ) ;
108
119 p. cargo ( "version" )
12- . with_stdout ( & format ! ( "cargo {}\n " , cargo:: version( ) ) )
10+ . with_stdout_data ( & format ! ( "cargo {}\n " , cargo:: version( ) ) )
1311 . run ( ) ;
1412
1513 p. cargo ( "--version" )
16- . with_stdout ( & format ! ( "cargo {}\n " , cargo:: version( ) ) )
14+ . with_stdout_data ( & format ! ( "cargo {}\n " , cargo:: version( ) ) )
1715 . run ( ) ;
1816
1917 p. cargo ( "-V" )
20- . with_stdout ( & format ! ( "cargo {}\n " , cargo:: version( ) ) )
18+ . with_stdout_data ( & format ! ( "cargo {}\n " , cargo:: version( ) ) )
2119 . run ( ) ;
2220}
2321
@@ -53,10 +51,19 @@ fn version_works_with_bad_target_dir() {
5351fn verbose ( ) {
5452 // This is mainly to check that it doesn't explode.
5553 cargo_process ( "-vV" )
56- . with_stdout_contains ( & format ! ( "cargo {}" , cargo:: version( ) ) )
57- . with_stdout_contains ( "host: [..]" )
58- . with_stdout_contains ( "libgit2: [..]" )
59- . with_stdout_contains ( "libcurl: [..]" )
60- . with_stdout_contains ( "os: [..]" )
54+ . with_stdout_data ( format ! (
55+ "\
56+ cargo {}
57+ release: [..]
58+ commit-hash: [..]
59+ commit-date: [..]
60+ host: [HOST_TARGET]
61+ libgit2: [..] (sys:[..] [..])
62+ libcurl: [..] (sys:[..] [..])
63+ ...
64+ os: [..]
65+ " ,
66+ cargo:: version( )
67+ ) )
6168 . run ( ) ;
6269}
You can’t perform that action at this time.
0 commit comments