From 8f3a46bccf439e70e069fde86c065adf791927ed Mon Sep 17 00:00:00 2001 From: Ryan Date: Mon, 29 Aug 2022 19:26:18 -0700 Subject: [PATCH] Tweak tests --- valence_nbt/src/tests.rs | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/valence_nbt/src/tests.rs b/valence_nbt/src/tests.rs index 1662b44..e106d9e 100644 --- a/valence_nbt/src/tests.rs +++ b/valence_nbt/src/tests.rs @@ -1,4 +1,3 @@ -use std::marker::PhantomData; use pretty_assertions::assert_eq; use serde::{Deserialize, Serialize}; @@ -20,6 +19,8 @@ struct Struct { byte_array: Vec, #[serde(with = "long_array")] long_array: Vec, + some_int: Option, + none_int: Option, } #[derive(PartialEq, Debug, Serialize, Deserialize)] @@ -46,6 +47,8 @@ impl Struct { int_array: vec![5, -9, i32::MIN, 0, i32::MAX], byte_array: vec![0, 1, 2], long_array: vec![123, 456, 789], + some_int: Some(321), + none_int: None, } } @@ -75,6 +78,7 @@ impl Struct { ), ("byte_array".into(), vec![0_i8, 1, 2].into()), ("long_array".into(), vec![123_i64, 456, 789].into()), + ("some_int".into(), 321.into()), ]) .into(), ) @@ -199,25 +203,3 @@ fn value_from_json() { assert_eq!(struct_, struct_de); } - -#[test] -fn some_none_round_trip() { - let mut buf = Vec::new(); - - #[derive(Serialize, Deserialize, PartialEq, Eq, Debug)] - struct Options { - some: Option, - none: Option, - } - - let opts = Options { - some: Some(123), - none: None, - }; - - to_writer(&mut buf, &opts).unwrap(); - - let opts_de = from_reader(&mut buf.as_slice()).unwrap(); - - assert_eq!(opts, opts_de); -}