Made tests more readable

This commit is contained in:
Daniel 2015-08-08 14:52:57 +02:00
parent dc571838bb
commit 9bb6325846
1 changed files with 7 additions and 16 deletions

View File

@ -633,16 +633,13 @@ fn test_cholesky_const() {
let result = na::cholesky(&a); let result = na::cholesky(&a);
match result { assert!(result.is_ok());
Ok(v) => {
assert!(na::approx_eq(&v, &g));
let recomp = v * na::transpose(&v); let v = result.unwrap();
assert!(na::approx_eq(&recomp, &a)); assert!(na::approx_eq(&v, &g));
},
Err(_) => assert!(false), let recomp = v * na::transpose(&v);
} assert!(na::approx_eq(&recomp, &a));
} }
#[test] #[test]
@ -652,10 +649,7 @@ fn test_cholesky_not_spd() {
let result = na::cholesky(&a); let result = na::cholesky(&a);
match result { assert!(result.is_err());
Ok(_) => assert!(false),
Err(_) => assert!(true),
}
} }
#[test] #[test]
@ -665,10 +659,7 @@ fn test_cholesky_not_symmetric() {
let result = na::cholesky(&a); let result = na::cholesky(&a);
match result { assert!(result.is_err());
Ok(_) => assert!(false),
Err(_) => assert!(true),
}
} }
#[test] #[test]