Skip to content

Commit

Permalink
add RON serde testing to mixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
knickish committed Jul 19, 2023
1 parent 60c3c8f commit c62806f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tests/ser_de.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use nanoserde::{DeBin, DeJson, SerBin, SerJson};
use nanoserde::{DeBin, DeJson, DeRon, SerBin, SerJson, SerRon};

use std::collections::HashMap;

#[test]
fn ser_de() {
#[derive(DeBin, SerBin, DeJson, SerJson, PartialEq)]
#[derive(DeBin, SerBin, DeJson, SerJson, DeRon, SerRon, PartialEq, Debug)]
pub struct Test {
pub a: i32,
pub b: f32,
Expand All @@ -28,9 +28,13 @@ fn ser_de() {

let bytes = SerBin::serialize_bin(&test);
let test_deserialized = DeBin::deserialize_bin(&bytes).unwrap();
assert!(test == test_deserialized);
assert_eq!(test, test_deserialized);

let bytes = SerJson::serialize_json(&test);
let test_deserialized = DeJson::deserialize_json(&bytes).unwrap();
assert!(test == test_deserialized);
assert_eq!(test, test_deserialized);

let bytes = SerRon::serialize_ron(&test);
let test_deserialized = DeRon::deserialize_ron(&bytes).unwrap();
assert_eq!(test, test_deserialized);
}

0 comments on commit c62806f

Please sign in to comment.