Skip to content

Commit f4f503d

Browse files
committed
Add RawRangeResponse test
1 parent be54a99 commit f4f503d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

packages/std/src/query/wasm.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,4 +261,20 @@ mod tests {
261261
}
262262
);
263263
}
264+
265+
#[test]
266+
fn raw_range_response_serialization() {
267+
let response = RawRangeResponse {
268+
data: vec![
269+
(Binary::from(b"key"), Binary::from(b"value")),
270+
(Binary::from(b"foo"), Binary::from(b"bar")),
271+
],
272+
next_key: Some(Binary::from(b"next")),
273+
};
274+
let json = to_json_binary(&response).unwrap();
275+
assert_eq!(
276+
String::from_utf8_lossy(&json),
277+
r#"{"data":[["a2V5","dmFsdWU="],["Zm9v","YmFy"]],"next_key":"bmV4dA=="}"#,
278+
);
279+
}
264280
}

0 commit comments

Comments
 (0)