Skip to content

tests fail with --no-default-features --features 'quickcheck' #331

@kentfredric

Description

@kentfredric

This may not be important to you, just something I spotted when running some testing during linux-vendorizing.

# cargo test --no-default-features --features 'quickcheck'
warning: unused import: `node_index`
 --> src/quickcheck.rs:4:20
  |
4 | use crate::graph::{node_index, IndexType};
  |                    ^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `crate::visit::NodeIndexable`
  --> src/quickcheck.rs:11:5
   |
11 | use crate::visit::NodeIndexable;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `node_index`
 --> src/quickcheck.rs:4:20
  |
4 | use crate::graph::{node_index, IndexType};
  |                    ^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `crate::visit::NodeIndexable`
  --> src/quickcheck.rs:11:5
   |
11 | use crate::visit::NodeIndexable;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^

   Compiling petgraph v0.5.0 (/home/kent/.cpanm/work/1581908821.17557/petgraph-0.5.0)
warning: function is never used: `degree`
    --> tests/graph.rs:1609:4
     |
1609 | fn degree<'a, G>(g: G, node: G::NodeId) -> usize
     |    ^^^^^^
     |
     = note: `#[warn(dead_code)]` on by default

error[E0432]: unresolved import `petgraph::graphmap`
  --> tests/quickcheck.rs:31:15
   |
31 | use petgraph::graphmap::NodeTrait;
   |               ^^^^^^^^ could not find `graphmap` in `petgraph`

error[E0433]: failed to resolve: use of undeclared type or module `StableGraph`
   --> tests/quickcheck.rs:853:19
    |
853 |         let sgr = StableGraph::from(gr1.clone());
    |                   ^^^^^^^^^^^ use of undeclared type or module `StableGraph`

error[E0433]: failed to resolve: use of undeclared type or module `StableGraph`
   --> tests/quickcheck.rs:861:19
    |
861 |         let sgr = StableGraph::from(gr1.clone());
    |                   ^^^^^^^^^^^ use of undeclared type or module `StableGraph`

error[E0412]: cannot find type `StableGraph` in this scope
   --> tests/quickcheck.rs:218:34
    |
218 |     fn prop<Ty: EdgeType>(mut g: StableGraph<(), i32, Ty>) -> bool {
    |                                  ^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `StableGraph` in this scope
   --> tests/quickcheck.rs:247:39
    |
247 |     quickcheck::quickcheck(prop as fn(StableGraph<_, _, Directed>) -> bool);
    |                                       ^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `StableGraph` in this scope
   --> tests/quickcheck.rs:248:39
    |
248 |     quickcheck::quickcheck(prop as fn(StableGraph<_, _, Undirected>) -> bool);
    |                                       ^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `GraphMap` in this scope
   --> tests/quickcheck.rs:416:45
    |
416 | fn assert_graphmap_consistent<N, E, Ty>(g: &GraphMap<N, E, Ty>)
    |                                             ^^^^^^^^ not found in this scope

error[E0412]: cannot find type `GraphMap` in this scope
   --> tests/quickcheck.rs:447:34
    |
447 |     fn prop<Ty: EdgeType>(mut g: GraphMap<i8, (), Ty>, a: i8, b: i8) -> bool {
    |                                  ^^^^^^^^ not found in this scope

error[E0412]: cannot find type `DiGraphMap` in this scope
   --> tests/quickcheck.rs:461:39
    |
461 |     quickcheck::quickcheck(prop as fn(DiGraphMap<_, _>, _, _) -> bool);
    |                                       ^^^^^^^^^^ help: a type alias with a similar name exists: `DiGraph`
    | 
   ::: /home/kent/.cpanm/work/1581908821.17557/petgraph-0.5.0/src/graph_impl/mod.rs:342:1
    |
342 | pub type DiGraph<N, E, Ix = DefaultIx> = Graph<N, E, Directed, Ix>;
    | ------------------------------------------------------------------- similarly named type alias `DiGraph` defined here

error[E0412]: cannot find type `UnGraphMap` in this scope
   --> tests/quickcheck.rs:462:39
    |
462 |     quickcheck::quickcheck(prop as fn(UnGraphMap<_, _>, _, _) -> bool);
    |                                       ^^^^^^^^^^ help: a type alias with a similar name exists: `UnGraph`
    | 
   ::: /home/kent/.cpanm/work/1581908821.17557/petgraph-0.5.0/src/graph_impl/mod.rs:348:1
    |
348 | pub type UnGraph<N, E, Ix = DefaultIx> = Graph<N, E, Undirected, Ix>;
    | --------------------------------------------------------------------- similarly named type alias `UnGraph` defined here

error[E0412]: cannot find type `UnGraphMap` in this scope
   --> tests/quickcheck.rs:467:20
    |
467 |     fn prop(mut g: UnGraphMap<i8, ()>, a: i8, b: i8) -> bool {
    |                    ^^^^^^^^^^ help: a type alias with a similar name exists: `UnGraph`
    | 
   ::: /home/kent/.cpanm/work/1581908821.17557/petgraph-0.5.0/src/graph_impl/mod.rs:348:1
    |
348 | pub type UnGraph<N, E, Ix = DefaultIx> = Graph<N, E, Undirected, Ix>;
    | --------------------------------------------------------------------- similarly named type alias `UnGraph` defined here

error[E0412]: cannot find type `DiGraphMap` in this scope
   --> tests/quickcheck.rs:539:33
    |
539 |     fn graphmap_reverse_sccs(g: DiGraphMap<u16, ()>) -> bool {
    |                                 ^^^^^^^^^^ help: a type alias with a similar name exists: `DiGraph`
    | 
   ::: /home/kent/.cpanm/work/1581908821.17557/petgraph-0.5.0/src/graph_impl/mod.rs:342:1
    |
342 | pub type DiGraph<N, E, Ix = DefaultIx> = Graph<N, E, Directed, Ix>;
    | ------------------------------------------------------------------- similarly named type alias `DiGraph` defined here

error[E0412]: cannot find type `StableDiGraph` in this scope
   --> tests/quickcheck.rs:869:42
    |
869 |     fn test_graph_from_stable_graph(gr1: StableDiGraph<usize, usize>) -> () {
    |                                          ^^^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `StableDiGraph` in this scope
   --> tests/quickcheck.rs:903:36
    |
903 |     fn stable_di_graph_map_id(gr1: StableDiGraph<usize, usize>) -> () {
    |                                    ^^^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `StableUnGraph` in this scope
   --> tests/quickcheck.rs:910:36
    |
910 |     fn stable_un_graph_map_id(gr1: StableUnGraph<usize, usize>) -> () {
    |                                    ^^^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `StableDiGraph` in this scope
   --> tests/quickcheck.rs:917:43
    |
917 |     fn stable_di_graph_filter_map_id(gr1: StableDiGraph<usize, usize>) -> () {
    |                                           ^^^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `StableUnGraph` in this scope
   --> tests/quickcheck.rs:924:48
    |
924 |     fn test_stable_un_graph_filter_map_id(gr1: StableUnGraph<usize, usize>) -> () {
    |                                                ^^^^^^^^^^^^^ not found in this scope

error[E0412]: cannot find type `StableDiGraph` in this scope
   --> tests/quickcheck.rs:931:53
    |
931 |     fn stable_di_graph_filter_map_remove(gr1: Small<StableDiGraph<i32, i32>>,
    |                                                     ^^^^^^^^^^^^^ not found in this scope

error: aborting due to 18 previous errors

Some errors have detailed explanations: E0412, E0432, E0433.
For more information about an error, try `rustc --explain E0412`.
error: could not compile `petgraph`.

To learn more, run the command again with --verbose.

It looks like the quickcheck 'feature' ( which exists due to the opt-dep on quickcheck ) requires features "stable_graph" and "graphmap" to work.

This looks like it could be fixable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P-help-wantedCall for participation: Help is requested to fix this issue🔴 B-crateBug: A bug that prevents the correct use of petgraph

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions