yami 0.1.0

A lightweight, zero-copy, minimal-allocation YAML parser in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use quickcheck_macros::quickcheck;
use yami::parse;

/// Invariant: `parse` must never panic on arbitrary string inputs.
/// It must return either `Ok(Yaml)` or `Err(YamlError)`.
#[quickcheck]
fn prop_parse_never_panics(input: String) -> bool {
    let _ = parse(&input);
    true
}

/// Invariant: Repeatedly parsing the same input produces identical results.
#[quickcheck]
fn prop_parse_is_deterministic(input: String) -> bool {
    let res1 = parse(&input);
    let res2 = parse(&input);
    res1 == res2
}