mirror of
https://github.com/danog/strum.git
synced 2024-12-02 17:38:15 +01:00
24 lines
405 B
Rust
24 lines
405 B
Rust
|
extern crate strum;
|
||
|
#[macro_use]
|
||
|
extern crate strum_macros;
|
||
|
|
||
|
use strum::{EnumCount, IntoEnumIterator};
|
||
|
|
||
|
#[derive(Debug, EnumCount, EnumIter)]
|
||
|
enum Week {
|
||
|
Sunday,
|
||
|
Monday,
|
||
|
Tuesday,
|
||
|
Wednesday,
|
||
|
Thursday,
|
||
|
Friday,
|
||
|
Saturday,
|
||
|
}
|
||
|
|
||
|
#[test]
|
||
|
fn simple_test() {
|
||
|
assert_eq!(7, Week::count());
|
||
|
assert_eq!(Week::count(), WEEK_COUNT);
|
||
|
assert_eq!(Week::iter().count(), WEEK_COUNT);
|
||
|
}
|