2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2015-01-28 08:34:18 -05:00
|
|
|
#[derive(PartialEq, Debug)]
|
2015-03-25 17:06:52 -07:00
|
|
|
struct Foo(isize, isize, String);
|
2013-02-21 14:57:27 +10:00
|
|
|
|
|
|
|
pub fn main() {
|
2014-05-25 03:17:19 -07:00
|
|
|
let a1 = Foo(5, 6, "abc".to_string());
|
|
|
|
let a2 = Foo(5, 6, "abc".to_string());
|
|
|
|
let b = Foo(5, 7, "def".to_string());
|
2013-02-21 14:57:27 +10:00
|
|
|
|
2015-06-07 21:00:38 +03:00
|
|
|
assert_eq!(a1, a1);
|
|
|
|
assert_eq!(a2, a1);
|
2013-03-28 18:39:09 -07:00
|
|
|
assert!(!(a1 == b));
|
2013-02-21 14:57:27 +10:00
|
|
|
|
2013-03-28 18:39:09 -07:00
|
|
|
assert!(a1 != b);
|
|
|
|
assert!(!(a1 != a1));
|
2013-05-18 22:02:45 -04:00
|
|
|
assert!(!(a2 != a1));
|
2013-02-21 14:57:27 +10:00
|
|
|
}
|