()
| 50 | |
| 51 | #[test] |
| 52 | fn test_text_negative_rotation() -> Result<(), StrError> { |
| 53 | // text object and options |
| 54 | let mut text = Text::new(); |
| 55 | |
| 56 | // draw text |
| 57 | text.set_align_horizontal("center") |
| 58 | .set_align_vertical("center") |
| 59 | .set_fontsize(20.0) |
| 60 | .set_rotation(-30.0) |
| 61 | .draw(0.5, 0.5, "NEGATIVE ROTATION"); |
| 62 | |
| 63 | // add text to plot |
| 64 | let mut plot = Plot::new(); |
| 65 | plot.add(&text).set_range(0.0, 1.0, 0.0, 1.0); |
| 66 | |
| 67 | // save figure |
| 68 | let path = Path::new(OUT_DIR).join("integ_text_negative_rotation.svg"); |
| 69 | plot.set_show_errors(true).save(&path)?; |
| 70 | |
| 71 | // check number of lines |
| 72 | let file = File::open(path).map_err(|_| "cannot open file")?; |
| 73 | let buffered = BufReader::new(file); |
| 74 | let lines_iter = buffered.lines(); |
| 75 | let n = lines_iter.count(); |
| 76 | assert!(n > 570 && n < 620); |
| 77 | Ok(()) |
| 78 | } |
| 79 | |
| 80 | #[test] |
| 81 | fn test_text_3d() -> Result<(), StrError> { |
nothing calls this directly
no test coverage detected