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 ;
12use std:: fmt:: { self , Display , Formatter } ;
23use std:: fs:: { remove_file} ;
34use std:: path:: { PathBuf } ;
45use std:: process:: { self , Command , Output } ;
5- use serde:: Deserialize ;
66
77const RUSTC_COLOR_ARGS : & [ & str ] = & [ "--color" , "always" ] ;
88
@@ -60,13 +60,20 @@ impl Display for Exercise {
6060 }
6161}
6262
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+ }
7279}
You can’t perform that action at this time.
0 commit comments