Test serde_json interoperability
This commit is contained in:
parent
985e21003f
commit
14338b8556
|
@ -1,4 +1,5 @@
|
|||
extern crate serde;
|
||||
extern crate serde_json;
|
||||
extern crate toml;
|
||||
#[macro_use]
|
||||
extern crate serde_derive;
|
||||
|
@ -589,3 +590,15 @@ fn fixed_size_array() {
|
|||
assert_eq!(value, expected);
|
||||
assert_eq!(toml::to_string(&value).unwrap(), text);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn json_interoperability() {
|
||||
#[derive(Serialize, Deserialize)]
|
||||
struct Foo {
|
||||
any: toml::Value
|
||||
}
|
||||
|
||||
let _foo: Foo = serde_json::from_str(r#"
|
||||
{"any":1}
|
||||
"#).unwrap();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue