()
| 428 | |
| 429 | #[test] |
| 430 | fn draw_cylinder_fails_on_wrong_input() { |
| 431 | let mut surf = Surface::new(); |
| 432 | let res = surf.draw_cylinder(&[0.0, 0.0], &[1.0, 1.0, 1.0], 1.0, 1, 3); |
| 433 | assert_eq!(res.err(), Some("a.len() must equal to 3")); |
| 434 | |
| 435 | let res = surf.draw_cylinder(&[0.0, 0.0, 0.0], &[1.0, 1.0], 1.0, 1, 3); |
| 436 | assert_eq!(res.err(), Some("b.len() must equal to 3")); |
| 437 | |
| 438 | let res = surf.draw_cylinder(&[0.0, 0.0, 0.0], &[1.0, 1.0, 1.0], 1.0, 0, 3); |
| 439 | assert_eq!(res.err(), Some("ndiv_axis must be ≥ 1")); |
| 440 | |
| 441 | let res = surf.draw_cylinder(&[0.0, 0.0, 0.0], &[1.0, 1.0, 1.0], 1.0, 1, 2); |
| 442 | assert_eq!(res.err(), Some("ndiv_perimeter must be ≥ 3")); |
| 443 | |
| 444 | let res = surf.draw_cylinder(&[0.0, 0.0, 0.0], &[0.0, 0.0, 0.0], 1.0, 1, 3); |
| 445 | assert_eq!(res.err(), Some("a-to-b segment is too short")); |
| 446 | } |
| 447 | |
| 448 | #[test] |
| 449 | fn draw_cylinder_works() { |
nothing calls this directly
no test coverage detected