Skip to content

Commit

Permalink
fixup! Add test to deserialize unsigned int
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasbeyer committed Jul 26, 2022
1 parent 69ef882 commit 392ed19
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/unsigned_int.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#![cfg(feature = "preserve_order")]

extern crate indexmap;

#[derive(serde::Deserialize, Eq, PartialEq, Debug)]
struct Container<T> {
inner: T,
Expand All @@ -16,20 +20,20 @@ impl Default for Unsigned {

impl From<Unsigned> for config::ValueKind {
fn from(unsigned: Unsigned) -> Self {
let mut properties = std::collections::HashMap::default();
let mut properties = indexmap::IndexMap::new();
properties.insert(
"unsigned".to_string(),
config::Value::from(unsigned.unsigned),
);

Self::Table(properties)
Self::Table(properties.into())
}
}

#[test]
fn test_deser_unsigned_int() {
let container = Container {
inner: Unsigned::default()
inner: Unsigned::default(),
};

let built = config::Config::builder()
Expand Down

0 comments on commit 392ed19

Please sign in to comment.