khive-types 0.13.0

Core type primitives: Id128, Timestamp, Namespace, and the 3 substrate data types (Note, Entity, Event).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use super::json_type_name;
use serde_json::json;

#[test]
fn json_type_names_cover_all_six_variants() {
    for (value, expected) in [
        (json!(null), "null"),
        (json!(true), "boolean"),
        (json!(7), "number"),
        (json!(-1.25), "number"),
        (json!("text"), "string"),
        (json!([]), "array"),
        (json!({}), "object"),
    ] {
        assert_eq!(json_type_name(&value), expected);
    }
}