File tree Expand file tree Collapse file tree 6 files changed +91
-0
lines changed
tests/testsuite/cargo_add Expand file tree Collapse file tree 6 files changed +91
-0
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ mod preserve_features_unsorted;
134134mod preserve_sorted;
135135mod preserve_unsorted;
136136mod public;
137+ mod public_common_version;
137138mod quiet;
138139mod registry;
139140mod rename;
Original file line number Diff line number Diff line change 1+ cargo-features = [" public-dependency" ]
2+ [workspace ]
3+
4+ [package ]
5+ name = " cargo-list-test-fixture"
6+ version = " 0.0.0"
7+ edition = " 2015"
8+
9+ [dependencies ]
10+ my-package = " 0.1.0"
Original file line number Diff line number Diff line change 1+ use crate :: prelude:: * ;
2+ use cargo_test_support:: Project ;
3+ use cargo_test_support:: compare:: assert_ui;
4+ use cargo_test_support:: current_dir;
5+ use cargo_test_support:: file;
6+ use cargo_test_support:: registry:: Dependency ;
7+ use cargo_test_support:: str;
8+
9+ #[ cargo_test]
10+ fn case ( ) {
11+ cargo_test_support:: registry:: init ( ) ;
12+ cargo_test_support:: registry:: Package :: new ( "my-package-dep" , "0.1.0" ) . publish ( ) ;
13+ cargo_test_support:: registry:: Package :: new ( "my-package-dep" , "0.2.0" ) . publish ( ) ;
14+ cargo_test_support:: registry:: Package :: new ( "my-package" , "0.1.0" )
15+ . add_dep ( Dependency :: new ( "my-package-dep" , "0.1.0" ) . public ( true ) )
16+ . publish ( ) ;
17+ cargo_test_support:: registry:: Package :: new ( "my-package" , "0.2.0" )
18+ . add_dep ( Dependency :: new ( "my-package-dep" , "0.2.0" ) . public ( true ) )
19+ . publish ( ) ;
20+ let project = Project :: from_template ( current_dir ! ( ) . join ( "in" ) ) ;
21+ let project_root = project. root ( ) ;
22+ let cwd = & project_root;
23+
24+ snapbox:: cmd:: Command :: cargo_ui ( )
25+ . arg ( "add" )
26+ . arg_line ( "my-package-dep" )
27+ . current_dir ( cwd)
28+ . masquerade_as_nightly_cargo ( & [ "public-dependency" ] )
29+ . assert ( )
30+ . success ( )
31+ . stdout_eq ( str![ "" ] )
32+ . stderr_eq ( file ! [ "stderr.term.svg" ] ) ;
33+
34+ assert_ui ( ) . subset_matches ( current_dir ! ( ) . join ( "out" ) , & project_root) ;
35+ }
Original file line number Diff line number Diff line change 1+ cargo-features = [" public-dependency" ]
2+ [workspace ]
3+
4+ [package ]
5+ name = " cargo-list-test-fixture"
6+ version = " 0.0.0"
7+ edition = " 2015"
8+
9+ [dependencies ]
10+ my-package = " 0.1.0"
11+ my-package-dep = " 0.2.0"
You can’t perform that action at this time.
0 commit comments