()
| 4 | |
| 5 | #[test] |
| 6 | fn encode_vector_hits() { |
| 7 | let hits = vec![ |
| 8 | VectorSearchHit { |
| 9 | id: 1, |
| 10 | distance: 0.5, |
| 11 | doc_id: None, |
| 12 | body: None, |
| 13 | }, |
| 14 | VectorSearchHit { |
| 15 | id: 2, |
| 16 | distance: 0.8, |
| 17 | doc_id: None, |
| 18 | body: None, |
| 19 | }, |
| 20 | ]; |
| 21 | let bytes = encode(&hits).unwrap(); |
| 22 | assert!(!bytes.is_empty()); |
| 23 | |
| 24 | let json = decode_payload_to_json(&bytes); |
| 25 | assert!(json.contains("\"id\"")); |
| 26 | assert!(json.contains("\"distance\"")); |
| 27 | } |
| 28 | |
| 29 | #[test] |
| 30 | fn encode_count_msg() { |
nothing calls this directly
no test coverage detected