2 #![allow(non_camel_case_types)]
6 enum color { red = 1, green, blue, imaginary = -1, }
9 test_color(color
::red
, 1, "red".to_string());
10 test_color(color
::green
, 2, "green".to_string());
11 test_color(color
::blue
, 3, "blue".to_string());
12 test_color(color
::imaginary
, -1, "imaginary".to_string());
15 fn test_color(color
: color
, val
: isize, _name
: String
) {
16 assert_eq
!(color
as isize , val
);