@@ -719,20 +719,14 @@ mod tests {
719
719
// Testing error cases
720
720
//
721
721
use crate :: layout:: MatrixLayout ;
722
- use ndarray:: ErrorKind ;
723
722
724
723
#[ test]
725
724
fn test_incompatible_shape_error_on_mismatching_num_rows ( ) {
726
725
let a: Array2 < f64 > = array ! [ [ 1. , 2. ] , [ 4. , 5. ] , [ 3. , 4. ] ] ;
727
726
let b: Array1 < f64 > = array ! [ 1. , 2. ] ;
728
727
let res = a. least_squares ( & b) ;
729
728
match res {
730
- Err ( err) => match err {
731
- LinalgError :: Shape ( shape_error) => {
732
- assert_eq ! ( shape_error. kind( ) , ErrorKind :: IncompatibleShape )
733
- }
734
- _ => panic ! ( "Expected ShapeError" ) ,
735
- } ,
729
+ Err ( LinalgError :: Lapack ( err) ) if matches ! ( err, lapack:: error:: Error :: InvalidShape ) => { }
736
730
_ => panic ! ( "Expected Err()" ) ,
737
731
}
738
732
}
@@ -745,12 +739,7 @@ mod tests {
745
739
746
740
let res = a. least_squares ( & b) ;
747
741
match res {
748
- Err ( err) => match err {
749
- LinalgError :: Shape ( shape_error) => {
750
- assert_eq ! ( shape_error. kind( ) , ErrorKind :: IncompatibleShape )
751
- }
752
- _ => panic ! ( "Expected ShapeError" ) ,
753
- } ,
742
+ Err ( LinalgError :: Lapack ( err) ) if matches ! ( err, lapack:: error:: Error :: InvalidShape ) => { }
754
743
_ => panic ! ( "Expected Err()" ) ,
755
744
}
756
745
}
0 commit comments