@@ -65,12 +65,27 @@ mod tests {
65
65
}
66
66
67
67
#[ test]
68
- fn count_equals_for ( ) {
68
+ fn count_some ( ) {
69
69
let map = get_map ( ) ;
70
- assert_eq ! (
71
- count_for( & map, Progress :: Complete ) ,
72
- count_iterator( & map, Progress :: Complete )
73
- ) ;
70
+ assert_eq ! ( 1 , count_iterator( & map, Progress :: Some ) ) ;
71
+ }
72
+
73
+ #[ test]
74
+ fn count_none ( ) {
75
+ let map = get_map ( ) ;
76
+ assert_eq ! ( 2 , count_iterator( & map, Progress :: None ) ) ;
77
+ }
78
+
79
+ #[ test]
80
+ fn count_complete_equals_for ( ) {
81
+ let map = get_map ( ) ;
82
+ let progressStates = vec ! [ Progress :: Complete , Progress :: Some , Progress :: None ] ;
83
+ for progressState in progressStates {
84
+ assert_eq ! (
85
+ count_for( & map, progressState) ,
86
+ count_iterator( & map, progressState)
87
+ ) ;
88
+ }
74
89
}
75
90
76
91
#[ test]
@@ -82,13 +97,29 @@ mod tests {
82
97
) ;
83
98
}
84
99
100
+ #[ test]
101
+ fn count_collection_some ( ) {
102
+ let collection = get_vec_map ( ) ;
103
+ assert_eq ! ( 1 , count_collection_iterator( & collection, Progress :: Some ) ) ;
104
+ }
105
+
106
+ #[ test]
107
+ fn count_collection_none ( ) {
108
+ let collection = get_vec_map ( ) ;
109
+ assert_eq ! ( 4 , count_collection_iterator( & collection, Progress :: None ) ) ;
110
+ }
111
+
85
112
#[ test]
86
113
fn count_collection_equals_for ( ) {
114
+ let progressStates = vec ! [ Progress :: Complete , Progress :: Some , Progress :: None ] ;
87
115
let collection = get_vec_map ( ) ;
88
- assert_eq ! (
89
- count_collection_for( & collection, Progress :: Complete ) ,
90
- count_collection_iterator( & collection, Progress :: Complete )
91
- ) ;
116
+
117
+ for progressState in progressStates {
118
+ assert_eq ! (
119
+ count_collection_for( & collection, progressState) ,
120
+ count_collection_iterator( & collection, progressState)
121
+ ) ;
122
+ }
92
123
}
93
124
94
125
fn get_map ( ) -> HashMap < String , Progress > {
0 commit comments