We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 85d9cfb commit e9e799fCopy full SHA for e9e799f
src/libcollections/hashmap.rs
@@ -2003,6 +2003,20 @@ mod test_map {
2003
assert_eq!(m1, m2);
2004
}
2005
2006
+ #[test]
2007
+ fn test_show() {
2008
+ let mut map: HashMap<int, int> = HashMap::new();
2009
+ let empty: HashMap<int, int> = HashMap::new();
2010
+
2011
+ map.insert(1, 2);
2012
+ map.insert(3, 4);
2013
2014
+ let map_str = format!("{}", map);
2015
2016
+ assert!(map_str == "{1: 2, 3: 4}".to_owned() || map_str == "{3: 4, 1: 2}".to_owned());
2017
+ assert_eq!(format!("{}", empty), "{}".to_owned());
2018
+ }
2019
2020
#[test]
2021
fn test_expand() {
2022
let mut m = HashMap::new();
0 commit comments