()
| 139 | |
| 140 | #[test] |
| 141 | fn raw_msgpack_roundtrip() { |
| 142 | let (sparse, _dir) = make_engine(); |
| 143 | let doc_engine = DocumentEngine::new(&sparse, 1); |
| 144 | |
| 145 | let doc = serde_json::json!({"key": "value", "num": 42}); |
| 146 | let rmpv_val = json_to_msgpack(&doc); |
| 147 | let mut buf = Vec::new(); |
| 148 | rmpv::encode::write_value(&mut buf, &rmpv_val).unwrap(); |
| 149 | |
| 150 | doc_engine.put_raw("col", "id1", &buf).unwrap(); |
| 151 | |
| 152 | let raw = doc_engine.get_raw("col", "id1").unwrap().unwrap(); |
| 153 | assert_eq!(raw, buf); |
| 154 | |
| 155 | let decoded = doc_engine.get("col", "id1").unwrap().unwrap(); |
| 156 | assert_eq!(decoded["key"], "value"); |
| 157 | assert_eq!(decoded["num"], 42); |
| 158 | } |
| 159 | |
| 160 | #[test] |
| 161 | fn collections_are_isolated() { |
nothing calls this directly
no test coverage detected