Skip to content

Commit a0253e1

Browse files
committed
Add RawRangeResponse test
1 parent 4f2c527 commit a0253e1

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
@@ -259,4 +259,20 @@ mod tests {
259259
}
260260
);
261261
}
262+
263+
#[test]
264+
fn raw_range_response_serialization() {
265+
let response = RawRangeResponse {
266+
data: vec![
267+
(Binary::from(b"key"), Binary::from(b"value")),
268+
(Binary::from(b"foo"), Binary::from(b"bar")),
269+
],
270+
next_key: Some(Binary::from(b"next")),
271+
};
272+
let json = to_json_binary(&response).unwrap();
273+
assert_eq!(
274+
String::from_utf8_lossy(&json),
275+
r#"{"data":[["a2V5","dmFsdWU="],["Zm9v","YmFy"]],"next_key":"bmV4dA=="}"#,
276+
);
277+
}
262278
}

0 commit comments

Comments
 (0)