forked from rust-embedded-community/serde-json-core
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
722 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,6 +65,8 @@ pub use self::ser::{to_string, to_vec}; | |
|
||
#[cfg(test)] | ||
mod test { | ||
use std::collections::BTreeMap; | ||
|
||
use super::*; | ||
use serde_derive::{Deserialize, Serialize}; | ||
|
||
|
@@ -95,6 +97,7 @@ mod test { | |
published: bool, | ||
comments: Vec<CommentId>, | ||
stats: Stats, | ||
balances: BTreeMap<String, u16>, | ||
} | ||
|
||
#[test] | ||
|
@@ -107,7 +110,10 @@ mod test { | |
published: false, | ||
comments: vec![], | ||
stats: Stats { views: 0, score: 0 }, | ||
balances: BTreeMap::new(), | ||
}; | ||
let mut balances: BTreeMap<String, u16> = BTreeMap::new(); | ||
balances.insert("chareen".into(), 347); | ||
let max = Item { | ||
model: Model::Post { | ||
category: "fun".to_string(), | ||
|
@@ -122,6 +128,7 @@ mod test { | |
views: std::u64::MAX, | ||
score: std::i64::MIN, | ||
}, | ||
balances, | ||
}; | ||
|
||
// binary | ||
|
@@ -172,6 +179,9 @@ mod test { | |
author: Address("[email protected]".to_owned()), | ||
}); | ||
|
||
let mut balances: BTreeMap<String, u16> = BTreeMap::new(); | ||
balances.insert("chareen".into(), 347); | ||
|
||
let item = ModelOrItem::Item(Item { | ||
model: Model::Comment, | ||
title: "Title".to_owned(), | ||
|
@@ -183,6 +193,7 @@ mod test { | |
views: 110, | ||
score: 12, | ||
}, | ||
balances, | ||
}); | ||
|
||
assert_eq!( | ||
|
Oops, something went wrong.