File tree Expand file tree Collapse file tree 7 files changed +63
-0
lines changed
tests/testsuite/cargo_add Expand file tree Collapse file tree 7 files changed +63
-0
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,7 @@ mod path_dev;
9999mod path_inferred_name;
100100mod path_inferred_name_conflicts_full_feature;
101101mod path_normalized_name;
102+ mod preserve_dep_std_table;
102103mod preserve_features_table;
103104mod preserve_sorted;
104105mod preserve_unsorted;
Original file line number Diff line number Diff line change 1+ [package ]
2+ name = " xxx"
3+ version = " 0.1.0"
4+ edition = " 2021"
5+
6+ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+ [dependencies .your-face ]
9+ # Leading version
10+ version = " 99999.0.0" # Trailing version
11+ # Leading optional
12+ optional = true # Trailing optional
13+ # Leading features
14+ features = [] # Trailing features
Original file line number Diff line number Diff line change 1+ use cargo_test_support:: compare:: assert_ui;
2+ use cargo_test_support:: prelude:: * ;
3+ use cargo_test_support:: Project ;
4+
5+ use cargo_test_support:: curr_dir;
6+
7+ #[ cargo_test]
8+ fn case ( ) {
9+ cargo_test_support:: registry:: init ( ) ;
10+ cargo_test_support:: registry:: Package :: new ( "your-face" , "99999.0.0+my-package" )
11+ . feature ( "nose" , & [ ] )
12+ . feature ( "mouth" , & [ ] )
13+ . feature ( "eyes" , & [ ] )
14+ . feature ( "ears" , & [ ] )
15+ . publish ( ) ;
16+
17+ let project = Project :: from_template ( curr_dir ! ( ) . join ( "in" ) ) ;
18+ let project_root = project. root ( ) ;
19+ let cwd = & project_root;
20+
21+ snapbox:: cmd:: Command :: cargo_ui ( )
22+ . arg ( "add" )
23+ . arg_line ( "your-face --no-optional" )
24+ . current_dir ( cwd)
25+ . assert ( )
26+ . success ( )
27+ . stdout_matches_path ( curr_dir ! ( ) . join ( "stdout.log" ) )
28+ . stderr_matches_path ( curr_dir ! ( ) . join ( "stderr.log" ) ) ;
29+
30+ assert_ui ( ) . subset_matches ( curr_dir ! ( ) . join ( "out" ) , & project_root) ;
31+ }
Original file line number Diff line number Diff line change 1+ [package ]
2+ name = " xxx"
3+ version = " 0.1.0"
4+ edition = " 2021"
5+
6+ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+ [dependencies .your-face ]
9+ version = " 99999.0.0"
10+ features = []
Original file line number Diff line number Diff line change 1+ Updating `dummy-registry` index
2+ Adding your-face v99999.0.0 to dependencies.
3+ Features:
4+ - ears
5+ - eyes
6+ - mouth
7+ - nose
You can’t perform that action at this time.
0 commit comments