File tree 1 file changed +17
-10
lines changed 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change 1
1
//! Tests for displaying the cargo version.
2
2
3
- #![ allow( deprecated) ]
4
-
5
3
use cargo_test_support:: { cargo_process, project} ;
6
4
7
5
#[ cargo_test]
8
6
fn simple ( ) {
9
7
let p = project ( ) . build ( ) ;
10
8
11
9
p. cargo ( "version" )
12
- . with_stdout ( & format ! ( "cargo {}\n " , cargo:: version( ) ) )
10
+ . with_stdout_data ( & format ! ( "cargo {}\n " , cargo:: version( ) ) )
13
11
. run ( ) ;
14
12
15
13
p. cargo ( "--version" )
16
- . with_stdout ( & format ! ( "cargo {}\n " , cargo:: version( ) ) )
14
+ . with_stdout_data ( & format ! ( "cargo {}\n " , cargo:: version( ) ) )
17
15
. run ( ) ;
18
16
19
17
p. cargo ( "-V" )
20
- . with_stdout ( & format ! ( "cargo {}\n " , cargo:: version( ) ) )
18
+ . with_stdout_data ( & format ! ( "cargo {}\n " , cargo:: version( ) ) )
21
19
. run ( ) ;
22
20
}
23
21
@@ -53,10 +51,19 @@ fn version_works_with_bad_target_dir() {
53
51
fn verbose ( ) {
54
52
// This is mainly to check that it doesn't explode.
55
53
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
+ ) )
61
68
. run ( ) ;
62
69
}
You can’t perform that action at this time.
0 commit comments