artifact-app 0.6.3

Artifact is a design doc tool made for developers. It allows anyone to easily write and link their design docs both to each other and to source code, making it easy to track how complete their project is. Documents are revision controllable, can be rendered as a static web page and have a full suite of command line tools for searching, formatting and displaying them.
Documentation


/// This is mainly to test some assumptions about TOML
use super::*;

use toml::{Parser, Value, Table};

#[test]
fn test_assumptions() {
    // This test is to prove that is impossible to write artifact names
    // such as ART-foo.1
    // since this is made impossible by the toml format itself,
    // we can assume that such artifacts don't exist when we create them automatically
    // by parsing the text.
    let toml = "\
    [test]
    key = 'value'

    [test.1]
    key = 'value.1'
    ";

    let tbl = parse_text(toml);
    let test = get_table(&tbl, "test");
    let value = match test.get("key").unwrap() {
        &Value::String(ref s) => s,
        _ => unreachable!(),
    };
    assert_eq!(value, "value");
    let test_1 = get_table(&test, "1");
    let value = match test_1.get("key").unwrap() {
        &Value::String(ref s) => s,
        _ => unreachable!(),
    };
    assert_eq!(value, "value.1");
}