Crates.io | next_episode |
lib.rs | next_episode |
version | 0.3.0 |
source | src |
created_at | 2018-06-16 19:58:40.054732 |
updated_at | 2018-06-17 12:41:05.25387 |
description | Find the next possible episode |
homepage | https://github.com/athiwatc/next_episode |
repository | https://github.com/athiwatc/next_episode |
max_upload_size | |
id | 70402 |
size | 24,512 |
Get the next possible episode
Version 0.2.0:
const EP_LIST: &'static [&'static str] = &[
"SomeSeries.S01E01.1080p.SomeFormat.mkv",
"SomeSeries.S01E05.720p.SomeFormat2.mkv",
"SomeSeries.S01E02.720p.Format3.mkv",
"Fav.Series.S01E01.720p.Format1.mkv",
"Fav.Series.S02E02.1080p.Format2.mkv",
"Fav.Series.S03E02.720p.Format3.mkv",
];
#[test]
fn next_ep() {
let nxt = possible_next_episode("SomeSeries.S01E01.SomeFormat.mkv", &EP_LIST);
assert_eq!(nxt, Some("SomeSeries.S01E02.720p.Format3.mkv"));
}
#[test]
fn next_ep_sprase() {
let nxt = possible_next_episode("SomeSeries.S01E02.720p.Format3.mkv", &EP_LIST);
assert_eq!(nxt, Some("SomeSeries.S01E05.720p.SomeFormat2.mkv"));
}
#[test]
fn across_season() {
let nxt = possible_next_episode("Fav.Series.S01E01.720p.Format1.mkv", &EP_LIST);
assert_eq!(nxt, Some("Fav.Series.S02E02.1080p.Format2.mkv"));
}
#[test]
fn last_ep() {
let nxt = possible_next_episode("Fav.Series.S03E02.720p.Format3.mkv", &EP_LIST);
assert_eq!(nxt, None);
}