Create a unit test for parsing a shuffle mode from string
This commit is contained in:
parent
6856fe947a
commit
5a1e37c3c2
1 changed files with 13 additions and 0 deletions
|
@ -109,6 +109,19 @@ mod tests {
|
||||||
assert_eq!(unknown, Err(CmusError::UnknownAAAMode("unknown".to_string())));
|
assert_eq!(unknown, Err(CmusError::UnknownAAAMode("unknown".to_string())));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_parse_shuffle_mode_from_str() {
|
||||||
|
let off = Shuffle::from_str("off");
|
||||||
|
let tracks = Shuffle::from_str("tracks");
|
||||||
|
let albums = Shuffle::from_str("albums");
|
||||||
|
let unknown = Shuffle::from_str("unknown");
|
||||||
|
|
||||||
|
assert_eq!(off, Ok(Shuffle::Off));
|
||||||
|
assert_eq!(tracks, Ok(Shuffle::Tracks));
|
||||||
|
assert_eq!(albums, Ok(Shuffle::Albums));
|
||||||
|
assert_eq!(unknown, Err(CmusError::UnknownShuffleMode("unknown".to_string())));
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_parse_player_settings_from_str() {
|
fn test_parse_player_settings_from_str() {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue