@@ -177,6 +177,36 @@ void main() {
177
177
});
178
178
});
179
179
180
+ group ('ruleMap_' , () {
181
+ tearDown (() => SuffixRules .dispose ());
182
+
183
+ test ('afterInitialising_returnMap' , () {
184
+ SuffixRules .initFromList (['br' , 'br.nom' ]);
185
+ expect (SuffixRules .ruleMap, isNotNull);
186
+ expect (SuffixRules .ruleMap, hasLength (2 ));
187
+ expect (SuffixRules .ruleMap, containsPair ('br' , [Rule ('br' )]));
188
+ });
189
+
190
+ test ('beforeInitialising_returnNull' , () {
191
+ expect (SuffixRules .ruleMap, isNull);
192
+ });
193
+
194
+ test ('multipleRulesFromSameTld_combineIntoSameList' , () {
195
+ SuffixRules .initFromList (['br' , 'nom.br' , 'nom.mer.br' ]);
196
+ expect (SuffixRules .ruleMap, isNotNull);
197
+ expect (SuffixRules .ruleMap, hasLength (1 ));
198
+ expect (SuffixRules .ruleMap,
199
+ containsPair ('br' , [Rule ('br' ), Rule ('nom.br' ), Rule ('nom.mer.br' )]));
200
+ });
201
+
202
+ test ('modifyMap_exception' , () {
203
+ SuffixRules .initFromList (['br' , 'nom.br' ]);
204
+ expect (() => SuffixRules .ruleMap['rb' ] = [Rule ('rb' )],
205
+ throwsUnsupportedError);
206
+ expect (() => SuffixRules .ruleMap.remove ('br' ), throwsUnsupportedError);
207
+ });
208
+ });
209
+
180
210
group ('initFromList_' , () {
181
211
test ('listWithComments_commentsRemoved' , () {
182
212
var lines = < String > ['br' , '//comment' , 'nom.br' ];
0 commit comments