()
| 150 | |
| 151 | #[test] |
| 152 | fn json_roundtrip_through_msgpack() { |
| 153 | let original = serde_json::json!({"name": "alice", "age": 30, "tags": ["ml", "rust"]}); |
| 154 | let json_bytes = serde_json::to_vec(&original).unwrap(); |
| 155 | |
| 156 | // Convert JSON → MessagePack. |
| 157 | let msgpack_bytes = json_to_msgpack(&json_bytes); |
| 158 | assert_ne!( |
| 159 | json_bytes, msgpack_bytes, |
| 160 | "should convert to different format" |
| 161 | ); |
| 162 | |
| 163 | // Decode from MessagePack. |
| 164 | let decoded = decode_document(&msgpack_bytes).unwrap(); |
| 165 | assert_eq!(decoded, original); |
| 166 | } |
| 167 | |
| 168 | #[test] |
| 169 | fn json_input_detected_correctly() { |
nothing calls this directly
no test coverage detected