File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 85d9cfb809d8191a03e84c5754e2e778281e5ce9
2
+ refs/heads/master: e9e799f7506a620bcebd291d716e895faa9d427b
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: ec0258a381b88b5574e3f8ce72ae553ac3a574b7
5
5
refs/heads/try: 7c6c492fb2af9a85f21ff952942df3523b22fd17
Original file line number Diff line number Diff line change @@ -2003,6 +2003,20 @@ mod test_map {
2003
2003
assert_eq ! ( m1, m2) ;
2004
2004
}
2005
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
+
2006
2020
#[ test]
2007
2021
fn test_expand ( ) {
2008
2022
let mut m = HashMap :: new ( ) ;
You can’t perform that action at this time.
0 commit comments