textlane 0.7.0

Rust-native text processing pipeline — a unified replacement with native and JavaScript plugins
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use serde_json::json;
use textlane_core::File;

use super::write_file;

#[test]
fn writes_value_messages_and_data() {
    let mut file = File::new();
    file.warn("too long", Some("length"));
    assert_eq!(
        write_file(&file, "a"),
        json!({
            "value": "a",
            "messages": [{ "reason": "too long", "ruleId": "length", "source": null, "place": null }],
            "data": {},
        })
    );
}