diff options
Diffstat (limited to 'ex4_3/src/main.rs')
| -rw-r--r-- | ex4_3/src/main.rs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/ex4_3/src/main.rs b/ex4_3/src/main.rs new file mode 100644 index 0000000..158c1b3 --- /dev/null +++ b/ex4_3/src/main.rs @@ -0,0 +1,34 @@ +use std::cmp::PartialEq; + +struct Ticket { + title: String, + description: String, + status: String, +} + +impl PartialEq for Ticket { + fn eq(&self, other: &Self) -> bool { + self.title == other.title && + self.description == other.description && + self.status == other.status + } +} + +fn main() { + println!("Hello, world!"); +} + +#[cfg(test)] +mod tests { + use crate::*; + + #[test] + fn t0() { + let t = Ticket{ + title: String::from("t"), + description: String::from("d"), + status: String::from("s"), + }; + assert_eq!(t == t, true); + } +} |
