Skip to content

Commit

Permalink
Fix tests for binary formats
Browse files Browse the repository at this point in the history
  • Loading branch information
therustmonk committed May 5, 2018
1 parent a7fd3da commit 042a337
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/format_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
extern crate serde_derive;
extern crate yew;

use yew::format::{Json, Storable};
use yew::format::{Json, Text, Binary};

#[test]
fn json_format() {
Expand All @@ -11,9 +11,10 @@ fn json_format() {
value: u8,
}

let Json(data): Json<Result<Data, _>> = Json::from(Ok(r#"{"value": 123}"#.into()));
let Json(data): Json<Result<Data, _>> = Json::from(Ok(r#"{"value": 123}"#.to_string()));
let data = data.unwrap();
assert_eq!(data.value, 123);

let _stored: Storable = Json(&data).into();
let _stored: Text = Json(&data).into();
let _stored: Binary = Json(&data).into();
}

0 comments on commit 042a337

Please sign in to comment.