()
| 189 | |
| 190 | #[test] |
| 191 | fn msgpack_is_compact() { |
| 192 | let doc = serde_json::json!({ |
| 193 | "name": "Alice Wonderland", |
| 194 | "age": 30, |
| 195 | "tags": ["admin", "user"], |
| 196 | "active": true |
| 197 | }); |
| 198 | |
| 199 | let json_bytes = serde_json::to_vec(&doc).unwrap(); |
| 200 | let rmpv_val = json_to_msgpack(&doc); |
| 201 | let mut msgpack_bytes = Vec::new(); |
| 202 | rmpv::encode::write_value(&mut msgpack_bytes, &rmpv_val).unwrap(); |
| 203 | |
| 204 | assert!( |
| 205 | msgpack_bytes.len() < json_bytes.len(), |
| 206 | "msgpack {} bytes vs json {} bytes", |
| 207 | msgpack_bytes.len(), |
| 208 | json_bytes.len() |
| 209 | ); |
| 210 | } |
| 211 | |
| 212 | #[test] |
| 213 | fn json_msgpack_roundtrip_preserves_types() { |
nothing calls this directly
no test coverage detected