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
1
+ use serde:: Deserialize ;
1
2
use std:: fmt:: { self , Display , Formatter } ;
2
3
use std:: fs:: { remove_file} ;
3
4
use std:: path:: { PathBuf } ;
4
5
use std:: process:: { self , Command , Output } ;
5
- use serde:: Deserialize ;
6
6
7
7
const RUSTC_COLOR_ARGS : & [ & str ] = & [ "--color" , "always" ] ;
8
8
@@ -60,13 +60,20 @@ impl Display for Exercise {
60
60
}
61
61
}
62
62
63
- #[ test]
64
- fn test_clean ( ) {
65
- std:: fs:: File :: create ( & temp_file ( ) ) . unwrap ( ) ;
66
- let exercise = Exercise {
67
- path : PathBuf :: from ( "example.rs" ) ,
68
- mode : Mode :: Test ,
69
- } ;
70
- exercise. clean ( ) ;
71
- assert ! ( !std:: path:: Path :: new( & temp_file( ) ) . exists( ) ) ;
63
+ #[ cfg( test) ]
64
+ mod test {
65
+ use super :: * ;
66
+ use std:: path:: Path ;
67
+ use std:: fs:: File ;
68
+
69
+ #[ test]
70
+ fn test_clean ( ) {
71
+ File :: create ( & temp_file ( ) ) . unwrap ( ) ;
72
+ let exercise = Exercise {
73
+ path : PathBuf :: from ( "example.rs" ) ,
74
+ mode : Mode :: Test ,
75
+ } ;
76
+ exercise. clean ( ) ;
77
+ assert ! ( !Path :: new( & temp_file( ) ) . exists( ) ) ;
78
+ }
72
79
}
You can’t perform that action at this time.
0 commit comments