zhold-core 0.0.2

Deterministic domain model and retention policy for zhold
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::str::FromStr;

use super::history::HistoryKind;

#[test]
fn history_kinds_have_a_closed_stable_cli_vocabulary() {
    for (text, expected) in [
        ("build", HistoryKind::Build),
        ("collection", HistoryKind::Collection),
        ("hook", HistoryKind::Hook),
        ("quota", HistoryKind::Quota),
        ("recovery", HistoryKind::Recovery),
    ] {
        assert_eq!(HistoryKind::from_str(text), Ok(expected));
        assert_eq!(expected.to_string(), text);
    }
    assert!(HistoryKind::from_str("command").is_err());
}