@@ -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]
@@ -83,14 +98,36 @@ mod tests {
83
98
}
84
99
85
100
#[ test]
86
- fn count_collection_equals_for ( ) {
101
+ fn count_collection_some ( ) {
87
102
let collection = get_vec_map ( ) ;
88
103
assert_eq ! (
89
- count_collection_for ( & collection , Progress :: Complete ) ,
90
- count_collection_iterator( & collection, Progress :: Complete )
104
+ 1 ,
105
+ count_collection_iterator( & collection, Progress :: Some )
91
106
) ;
92
107
}
93
108
109
+ #[ test]
110
+ fn count_collection_none ( ) {
111
+ let collection = get_vec_map ( ) ;
112
+ assert_eq ! (
113
+ 4 ,
114
+ count_collection_iterator( & collection, Progress :: None )
115
+ ) ;
116
+ }
117
+
118
+ #[ test]
119
+ fn count_collection_equals_for ( ) {
120
+ let progressStates = vec ! [ Progress :: Complete , Progress :: Some , Progress :: None ] ;
121
+ let collection = get_vec_map ( ) ;
122
+
123
+ for progressState in progressStates {
124
+ assert_eq ! (
125
+ count_collection_for( & collection, progressState) ,
126
+ count_collection_iterator( & collection, progressState)
127
+ ) ;
128
+ }
129
+ }
130
+
94
131
fn get_map ( ) -> HashMap < String , Progress > {
95
132
use Progress :: * ;
96
133
0 commit comments