File tree 2 files changed +27
-0
lines changed
2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ remark -f *.md > /dev/null
8
8
cargo build --features debugging
9
9
cargo test --features debugging
10
10
cd clippy_lints && cargo test && cd ..
11
+ cd rustc_tools_util && cargo test && cd ..
11
12
mkdir -p ~ /rust/cargo/bin
12
13
cp target/debug/cargo-clippy ~ /rust/cargo/bin/cargo-clippy
13
14
cp target/debug/clippy-driver ~ /rust/cargo/bin/clippy-driver
Original file line number Diff line number Diff line change
1
+ #![ feature( test) ]
1
2
#![ feature( tool_lints) ]
2
3
3
4
use std:: env;
@@ -84,3 +85,28 @@ pub fn get_commit_date() -> Option<String> {
84
85
. ok ( )
85
86
. and_then ( |r| String :: from_utf8 ( r. stdout ) . ok ( ) )
86
87
}
88
+
89
+ #[ cfg( test) ]
90
+ mod test {
91
+ use super :: * ;
92
+
93
+ #[ test]
94
+ fn test_struct_local ( ) {
95
+ let vi = get_version_info ! ( ) ;
96
+ assert_eq ! ( vi. major, 0 ) ;
97
+ assert_eq ! ( vi. minor, 1 ) ;
98
+ assert_eq ! ( vi. patch, 0 ) ;
99
+ assert_eq ! ( vi. crate_name, "rustc_tools_util" ) ;
100
+ // hard to make positive tests for these since they will always change
101
+ assert ! ( vi. commit_hash. is_none( ) ) ;
102
+ assert ! ( vi. commit_date. is_none( ) ) ;
103
+ }
104
+
105
+ #[ test]
106
+ fn test_display_local ( ) {
107
+ let vi = get_version_info ! ( ) ;
108
+ let fmt = format ! ( "{}" , vi) ;
109
+ assert_eq ! ( fmt, "rustc_tools_util 0.1.0" ) ;
110
+ }
111
+
112
+ }
You can’t perform that action at this time.
0 commit comments