File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 1
1
use anyhow:: { anyhow, Context , Result } ;
2
2
use assert_cmd:: prelude:: * ;
3
+ use cargo_metadata:: { Dependency , MetadataCommand } ;
3
4
use dylint_internal:: rustup:: SanitizeEnvironment ;
4
5
use predicates:: prelude:: * ;
5
6
use regex:: Regex ;
@@ -20,6 +21,8 @@ fn new_package() {
20
21
. assert ( )
21
22
. success ( ) ;
22
23
24
+ check_dylint_dependencies ( & path) . unwrap ( ) ;
25
+
23
26
dylint_internal:: packaging:: use_local_packages ( & path) . unwrap ( ) ;
24
27
25
28
dylint_internal:: cargo:: build ( "filled-in dylint-template" , false )
@@ -35,6 +38,18 @@ fn new_package() {
35
38
. unwrap ( ) ;
36
39
}
37
40
41
+ fn check_dylint_dependencies ( path : & Path ) -> Result < ( ) > {
42
+ let metadata = MetadataCommand :: new ( ) . current_dir ( path) . no_deps ( ) . exec ( ) ?;
43
+ for package in metadata. packages {
44
+ for Dependency { name : dep, req, .. } in & package. dependencies {
45
+ if dep. starts_with ( "dylint" ) {
46
+ assert_eq ! ( "^" . to_owned( ) + env!( "CARGO_PKG_VERSION" ) , req. to_string( ) ) ;
47
+ }
48
+ }
49
+ }
50
+ Ok ( ( ) )
51
+ }
52
+
38
53
#[ test]
39
54
fn downgrade_upgrade_package ( ) {
40
55
let tempdir = tempdir ( ) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments