rust/tests/ui/deriving/deriving-via-extension-enum.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
283 B
Rust
Raw Normal View History

// run-pass
#![allow(dead_code)]
2015-01-28 07:34:18 -06:00
#[derive(PartialEq, Debug)]
enum Foo {
Bar(isize, isize),
Baz(f64, f64)
}
pub fn main() {
let a = Foo::Bar(1, 2);
let b = Foo::Bar(1, 2);
assert_eq!(a, b);
2013-03-28 20:39:09 -05:00
assert!(!(a != b));
assert!(a.eq(&b));
assert!(!a.ne(&b));
}