File tree Expand file tree Collapse file tree 12 files changed +120
-0
lines changed 
inherit_workspace_package_table Expand file tree Collapse file tree 12 files changed +120
-0
lines changed Original file line number Diff line number Diff line change 1+ [workspace ]
2+ members  = [
3+   " crates/*" 
4+ ]
5+ 
6+ [workspace .package ]
7+ authors  = [" Rustaceans" 
8+ description  = " foo" 
9+ edition  = " 2018" 
10+ homepage  = " foo" 
11+ keywords  = [" foo" " bar" 
12+ readme  = " README.md" 
13+ rust-version  = " 1.67.0" 
14+ categories  = [" algorithms" 
15+ documentation  = " foo" 
16+ exclude  = [" foo" 
17+ include  = [" foo" 
18+ license  = " MIT OR Apache-2.0" 
19+ publish  = false 
20+ repository  = " foo" 
21+ version  = " 1.2.3" 
Original file line number Diff line number Diff line change 1+ fn  main ( )  { 
2+     println ! ( "Check that our file is not overwritten" ) 
3+ } 
Original file line number Diff line number Diff line change 1+ pub  fn  add ( left :  usize ,  right :  usize )  -> usize  { 
2+     left + right
3+ } 
4+ 
5+ #[ cfg( test) ]  
6+ mod  tests { 
7+     use  super :: * ; 
8+ 
9+     #[ test]  
10+     fn  it_works ( )  { 
11+         let  result = add ( 2 ,  2 ) ; 
12+         assert_eq ! ( result,  4 ) ; 
13+     } 
14+ } 
Original file line number Diff line number Diff line change 1+ use  cargo_test_support:: compare:: assert_ui; 
2+ use  cargo_test_support:: curr_dir; 
3+ use  cargo_test_support:: CargoCommand ; 
4+ use  cargo_test_support:: Project ; 
5+ 
6+ #[ cargo_test]  
7+ fn  case ( )  { 
8+     let  project = Project :: from_template ( curr_dir ! ( ) . join ( "in" ) ) ; 
9+     let  project_root = project. root ( ) ; 
10+     let  cwd = & project_root; 
11+ 
12+     snapbox:: cmd:: Command :: cargo_ui ( ) 
13+         . arg ( "init" ) 
14+         . args ( [ "crates/foo" ] ) 
15+         . current_dir ( cwd) 
16+         . assert ( ) 
17+         . success ( ) 
18+         . stdout_matches_path ( curr_dir ! ( ) . join ( "stdout.log" ) ) 
19+         . stderr_matches_path ( curr_dir ! ( ) . join ( "stderr.log" ) ) ; 
20+ 
21+     assert_ui ( ) . subset_matches ( curr_dir ! ( ) . join ( "out" ) ,  & project_root) ; 
22+ } 
Original file line number Diff line number Diff line change 1+ [workspace ]
2+ members  = [
3+   " crates/*" 
4+ ]
5+ 
6+ [workspace .package ]
7+ authors  = [" Rustaceans" 
8+ description  = " foo" 
9+ edition  = " 2018" 
10+ homepage  = " foo" 
11+ keywords  = [" foo" " bar" 
12+ readme  = " README.md" 
13+ rust-version  = " 1.67.0" 
14+ categories  = [" algorithms" 
15+ documentation  = " foo" 
16+ exclude  = [" foo" 
17+ include  = [" foo" 
18+ license  = " MIT OR Apache-2.0" 
19+ publish  = false 
20+ repository  = " foo" 
21+ version  = " 1.2.3" 
Original file line number Diff line number Diff line change 1+ [package ]
2+ name  = " foo" 
3+ version.workspace  = true 
4+ edition.workspace  = true 
5+ publish.workspace  = true 
6+ authors.workspace  = true 
7+ categories.workspace  = true 
8+ description.workspace  = true 
9+ documentation.workspace  = true 
10+ exclude.workspace  = true 
11+ homepage.workspace  = true 
12+ include.workspace  = true 
13+ keywords.workspace  = true 
14+ license.workspace  = true 
15+ readme.workspace  = true 
16+ repository.workspace  = true 
17+ rust-version.workspace  = true 
18+ #  See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
19+ 
20+ [dependencies ]
Original file line number Diff line number Diff line change 1+ fn  main ( )  { 
2+     println ! ( "Check that our file is not overwritten" ) 
3+ } 
Original file line number Diff line number Diff line change 1+ pub  fn  add ( left :  usize ,  right :  usize )  -> usize  { 
2+     left + right
3+ } 
4+ 
5+ #[ cfg( test) ]  
6+ mod  tests { 
7+     use  super :: * ; 
8+ 
9+     #[ test]  
10+     fn  it_works ( )  { 
11+         let  result = add ( 2 ,  2 ) ; 
12+         assert_eq ! ( result,  4 ) ; 
13+     } 
14+ } 
Original file line number Diff line number Diff line change 1+      Created binary (application) package
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments