File tree Expand file tree Collapse file tree 7 files changed +48
-1
lines changed
tests/testsuite/cargo_add Expand file tree Collapse file tree 7 files changed +48
-1
lines changed Original file line number Diff line number Diff line change @@ -726,7 +726,8 @@ impl DependencyUI {
726726 . get ( next)
727727 . into_iter ( )
728728 . flatten ( )
729- . map ( |s| s. as_str ( ) ) ,
729+ . map ( |s| s. as_str ( ) )
730+ . filter ( |s| !activated. contains ( s) ) ,
730731 ) ;
731732 activated. extend (
732733 self . available_features
Original file line number Diff line number Diff line change 1+ ../add-basic.in
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 crate :: cargo_add:: init_registry;
6+ use cargo_test_support:: curr_dir;
7+
8+ #[ cargo_test]
9+ fn case ( ) {
10+ init_registry ( ) ;
11+ let project = Project :: from_template ( curr_dir ! ( ) . join ( "in" ) ) ;
12+ let project_root = project. root ( ) ;
13+ let cwd = & project_root;
14+
15+ snapbox:: cmd:: Command :: cargo_ui ( )
16+ . arg ( "add" )
17+ . arg_line ( "test_cyclic_features" )
18+ . current_dir ( cwd)
19+ . assert ( )
20+ . success ( )
21+ . stdout_matches_path ( curr_dir ! ( ) . join ( "stdout.log" ) )
22+ . stderr_matches_path ( curr_dir ! ( ) . join ( "stderr.log" ) ) ;
23+
24+ assert_ui ( ) . subset_matches ( curr_dir ! ( ) . join ( "out" ) , & project_root) ;
25+ }
Original file line number Diff line number Diff line change 1+ [workspace ]
2+
3+ [package ]
4+ name = " cargo-list-test-fixture"
5+ version = " 0.0.0"
6+
7+ [dependencies ]
8+ test_cyclic_features = " 0.1.1"
Original file line number Diff line number Diff line change 1+ Updating `dummy-registry` index
2+ Adding test_cyclic_features v0.1.1 to dependencies.
3+ Features:
4+ + feature-one
5+ + feature-two
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ mod add_normalized_name_external;
44mod build;
55mod build_prefer_existing_version;
66mod change_rename_target;
7+ mod cyclic_features;
78mod default_features;
89mod deprecated_default_features;
910mod deprecated_section;
@@ -165,6 +166,12 @@ fn add_registry_packages(alt: bool) {
165166 cargo_test_support:: registry:: Package :: new ( "test_nonbreaking" , "0.1.1" )
166167 . alternative ( alt)
167168 . publish ( ) ;
169+ cargo_test_support:: registry:: Package :: new ( "test_cyclic_features" , "0.1.1" )
170+ . alternative ( alt)
171+ . feature ( "default" , & [ "feature-one" , "feature-two" ] )
172+ . feature ( "feature-one" , & [ "feature-two" ] )
173+ . feature ( "feature-two" , & [ "feature-one" ] )
174+ . publish ( ) ;
168175
169176 // Normalization
170177 cargo_test_support:: registry:: Package :: new ( "linked-hash-map" , "0.5.4" )
You can’t perform that action at this time.
0 commit comments