1
use justjson::Value;
2

            
3
1
fn main() {
4
1
    let value = Value::from_json(r#"{"hello":"world"}"#).expect("error parsing json");
5
1
    let obj = value.as_object().expect("json contains an object");
6
1
    assert_eq!(obj[0].key, "hello");
7
1
    let value = obj[0].value.as_string().expect("value is a string");
8
1
    assert_eq!(value, "world");
9
1
}
10

            
11
1
#[test]
12
1
fn runs() {
13
1
    main();
14
1
}