File: reader.rs

package info (click to toggle)
rust-deser-hjson 2.2.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 252 kB
  • sloc: makefile: 4
file content (21 lines) | stat: -rw-r--r-- 399 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use {
    deser_hjson::from_reader,
    serde:: Deserialize,
};

#[macro_use] mod common;

#[test]
fn test_reader() {
    #[derive(Deserialize, PartialEq, Debug)]
    struct Test {
        a: i32,
        b: String,
    }
    let hjson = br#"{ a: 1, b: "2" }"#;
    let expected = Test {
        a: 1,
        b: "2".to_string(),
    };
    assert_eq!(expected, from_reader(&hjson[..]).unwrap());
}