Skip to content

Commit

Permalink
dxr: add bytes / base64 to client-server roundtrip tests
Browse files Browse the repository at this point in the history
  • Loading branch information
decathorpe committed Feb 5, 2022
1 parent 57e6795 commit 404a320
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dxr/tests/echo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct TestStruct {
}

#[tokio::test]
async fn test() {
async fn echo() {
let builder =
ServerBuilder::new("0.0.0.0:3000".parse().unwrap()).add_method("echo", Box::new(echo_handler as HandlerFn));
let _dbg_str = format!("{:#?}", &builder);
Expand Down Expand Up @@ -76,6 +76,12 @@ async fn test() {
let r = client.call(call).await.unwrap();
assert_eq!((value,), r);

// bytes
let value = b"HELLOWORLD".to_vec();
let call: Call<_, (Vec<u8>,)> = Call::new("echo", (value.as_slice(),));
let r = client.call(call).await.unwrap();
assert_eq!((value,), r);

// array
let value = vec![-12i32, 42i32];
let call: Call<_, Vec<i32>> = Call::new("echo", value.as_slice());
Expand Down

0 comments on commit 404a320

Please sign in to comment.