File tree 2 files changed +35
-0
lines changed
2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ mod package;
72
72
mod patch;
73
73
mod path;
74
74
mod paths;
75
+ mod pkgid;
75
76
mod plugins;
76
77
mod proc_macro;
77
78
mod profile_config;
Original file line number Diff line number Diff line change
1
+ //! Tests for the `cargo pkgid` command.
2
+
3
+ use cargo_test_support:: project;
4
+ use cargo_test_support:: registry:: Package ;
5
+
6
+ #[ cargo_test]
7
+ fn simple ( ) {
8
+ Package :: new ( "bar" , "0.1.0" ) . publish ( ) ;
9
+ let p = project ( )
10
+ . file (
11
+ "Cargo.toml" ,
12
+ r#"
13
+ [package]
14
+ name = "foo"
15
+ version = "0.1.0"
16
+ edition = "2018"
17
+
18
+ [dependencies]
19
+ bar = "0.1.0"
20
+ "# ,
21
+ )
22
+ . file ( "src/main.rs" , "fn main() {}" )
23
+ . build ( ) ;
24
+
25
+ p. cargo ( "generate-lockfile" ) . run ( ) ;
26
+
27
+ p. cargo ( "pkgid foo" )
28
+ . with_stdout ( format ! ( "file://[..]{}#0.1.0" , p. root( ) . to_str( ) . unwrap( ) ) )
29
+ . run ( ) ;
30
+
31
+ p. cargo ( "pkgid bar" )
32
+ . with_stdout ( "https://github.com/rust-lang/crates.io-index#bar:0.1.0" )
33
+ . run ( ) ;
34
+ }
You can’t perform that action at this time.
0 commit comments