1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
use thiserror::Error;
#[derive(Debug, PartialEq, Eq, Error)]
pub enum Error {
#[error(transparent)]
FromTopology(#[from] truck_topology::errors::Error),
#[error("cannot attach a plane to a wire that is not on one plane.")]
WireNotInOnePlane,
#[error("The wires must contain the same number of edges to create a homotopy.")]
NotSameNumberOfEdges,
}
#[test]
fn print_messages() {
use std::io::Write;
writeln!(
&mut std::io::stderr(),
"****** test of the expressions of error messages ******\n"
)
.unwrap();
writeln!(
&mut std::io::stderr(),
"{}\n",
Error::FromTopology(truck_topology::errors::Error::SameVertex)
)
.unwrap();
writeln!(&mut std::io::stderr(), "{}\n", Error::WireNotInOnePlane).unwrap();
writeln!(
&mut std::io::stderr(),
"*******************************************************"
)
.unwrap();
}