| 1 |
#[cfg(not(all( |
| 2 |
feature = "debug", |
| 3 |
feature = "compare", |
| 4 |
feature = "rand", |
| 5 |
feature = "macros" |
| 6 |
)))] |
| 7 |
compile_error!( |
| 8 |
"Please enable the `debug`, `compare`, `rand` and `macros` features in order to compile and run the tests. |
| 9 |
Example: `cargo test --features debug,compare,rand,macros`" |
| 10 |
); |
| 11 |
|
| 12 |
#[cfg(all(feature = "debug", feature = "compare", feature = "rand"))] |
| 13 |
#[macro_use] |
| 14 |
extern crate approx; |
| 15 |
extern crate nalgebra as na; |
| 16 |
extern crate num_traits as num; |
| 17 |
#[cfg(feature = "rand")] |
| 18 |
extern crate rand_package as rand; |
| 19 |
|
| 20 |
#[cfg(all(feature = "debug", feature = "compare", feature = "rand"))] |
| 21 |
mod core; |
| 22 |
#[cfg(all(feature = "debug", feature = "compare", feature = "rand"))] |
| 23 |
mod geometry; |
| 24 |
#[cfg(all(feature = "debug", feature = "compare", feature = "rand"))] |
| 25 |
mod linalg; |
| 26 |
|
| 27 |
#[cfg(all(feature = "debug", feature = "compare", feature = "rand"))] |
| 28 |
#[cfg(feature = "proptest-support")] |
| 29 |
mod proptest; |
| 30 |
|
| 31 |
#[cfg(feature = "macros")] |
| 32 |
mod macros; |
| 33 |
|
| 34 |
//#[cfg(all(feature = "debug", feature = "compare", feature = "rand"))] |
| 35 |
//#[cfg(feature = "sparse")] |
| 36 |
//mod sparse; |
| 37 |
|
| 38 |
mod utils { |
| 39 |
/// Checks if a slice is sorted in descending order. |
| 40 |
pub fn is_sorted_descending<T: PartialOrd>(slice: &[T]) -> bool { |
| 41 |
slice.windows(2).all(|elts| elts[0] >= elts[1]) |
| 42 |
} |
| 43 |
} |