Skip to content

Commit 86d6f4f

Browse files
committed
---
yaml --- r: 114525 b: refs/heads/master c: e9e799f h: refs/heads/master i: 114523: 559f0aa v: v3
1 parent 949a957 commit 86d6f4f

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 85d9cfb809d8191a03e84c5754e2e778281e5ce9
2+
refs/heads/master: e9e799f7506a620bcebd291d716e895faa9d427b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ec0258a381b88b5574e3f8ce72ae553ac3a574b7
55
refs/heads/try: 7c6c492fb2af9a85f21ff952942df3523b22fd17

trunk/src/libcollections/hashmap.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2003,6 +2003,20 @@ mod test_map {
20032003
assert_eq!(m1, m2);
20042004
}
20052005

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+
20062020
#[test]
20072021
fn test_expand() {
20082022
let mut m = HashMap::new();

0 commit comments

Comments
 (0)