]> git.proxmox.com Git - cargo.git/commitdiff
Properly fix assertion and tests
authorAaron Hill <aa1ronham@gmail.com>
Fri, 26 Apr 2019 04:07:04 +0000 (00:07 -0400)
committerAaron Hill <aa1ronham@gmail.com>
Fri, 26 Apr 2019 04:07:04 +0000 (00:07 -0400)
src/cargo/core/dependency.rs
tests/testsuite/support/resolver.rs

index 0ac6716ea63ebb37d2fa0e33d609d32fef61dc83..f1a87e0a6f9f286beac945c1035cb70e4152ed91 100644 (file)
@@ -301,8 +301,8 @@ impl Dependency {
 
     /// Sets whether the dependency is public.
     pub fn set_public(&mut self, public: bool) -> &mut Dependency {
-        if !public {
-            // Setting 'private' only makes sense for normal dependencies
+        if public {
+            // Setting 'public' only makes sense for normal dependencies
             assert_eq!(self.kind(), Kind::Normal);
         }
         Rc::make_mut(&mut self.inner).public = public;
index 84bbf3d8317d35c19bf8e1adc6ad81caba6195ab..fd5dc22db02bb3498eade42bd1fb0e9b109202e4 100644 (file)
@@ -348,8 +348,8 @@ fn meta_test_deep_pretty_print_registry() {
                 pkg!(("baz", "1.0.1")),
                 pkg!(("cat", "1.0.2") => [dep_req_kind("other", "2", Kind::Build, false)]),
                 pkg!(("cat", "1.0.3") => [dep_req_kind("other", "2", Kind::Development, false)]),
-                pkg!(("cat", "1.0.4") => [dep_req_kind("other", "2", Kind::Build, true)]),
-                pkg!(("cat", "1.0.5") => [dep_req_kind("other", "2", Kind::Development, true)]),
+                pkg!(("cat", "1.0.4") => [dep_req_kind("other", "2", Kind::Build, false)]),
+                pkg!(("cat", "1.0.5") => [dep_req_kind("other", "2", Kind::Development, false)]),
                 pkg!(("dep_req", "1.0.0")),
                 pkg!(("dep_req", "2.0.0")),
             ])
@@ -363,8 +363,8 @@ fn meta_test_deep_pretty_print_registry() {
          pkg!((\"baz\", \"1.0.1\")),\
          pkg!((\"cat\", \"1.0.2\") => [dep_req_kind(\"other\", \"^2\", Kind::Build, false),]),\
          pkg!((\"cat\", \"1.0.3\") => [dep_req_kind(\"other\", \"^2\", Kind::Development, false),]),\
-         pkg!((\"cat\", \"1.0.4\") => [dep_req_kind(\"other\", \"^2\", Kind::Build, true),]),\
-         pkg!((\"cat\", \"1.0.5\") => [dep_req_kind(\"other\", \"^2\", Kind::Development, true),]),\
+         pkg!((\"cat\", \"1.0.4\") => [dep_req_kind(\"other\", \"^2\", Kind::Build, false),]),\
+         pkg!((\"cat\", \"1.0.5\") => [dep_req_kind(\"other\", \"^2\", Kind::Development, false),]),\
          pkg!((\"dep_req\", \"1.0.0\")),\
          pkg!((\"dep_req\", \"2.0.0\")),]"
     )