@@ -27,13 +27,21 @@ void main() {
27
27
{'ident' : 'showDialog' , 'description' : 'Please use myShowDialog' },
28
28
{'ident' : 'strangeName' , 'description' : 'The name is too strange' },
29
29
{'ident' : 'AnotherStrangeName' , 'description' : 'Oops' },
30
+ {
31
+ 'ident' : 'StrangeClass.someMethod' ,
32
+ 'description' : 'Please use NonStrangeClass.someMethod instead' ,
33
+ },
34
+ {
35
+ 'ident' : 'DateTime.now' ,
36
+ 'description' : 'Please use clock.now instead' ,
37
+ },
30
38
],
31
39
}).check (unit);
32
40
33
41
RuleTestHelper .verifyIssues (
34
42
issues: issues,
35
- startLines: [6 , 7 , 9 , 12 , 15 , 16 ],
36
- startColumns: [3 , 12 , 7 , 1 , 1 , 12 ],
43
+ startLines: [7 , 8 , 10 , 13 , 16 , 17 , 20 , 23 , 24 , 26 ],
44
+ startColumns: [3 , 12 , 7 , 1 , 1 , 12 , 1 , 1 , 1 , 28 ],
37
45
locationTexts: [
38
46
'showDialog' ,
39
47
'showDialog' ,
@@ -43,6 +51,10 @@ void main() {
43
51
' late var strangeName; // LINT\n '
44
52
'}' ,
45
53
'strangeName' ,
54
+ 'StrangeClass.someMethod();' ,
55
+ 'DateTime.now();' ,
56
+ 'DateTime.now()' ,
57
+ 'DateTime.now' ,
46
58
],
47
59
messages: [
48
60
'Please use myShowDialog (showDialog is banned)' ,
@@ -51,6 +63,10 @@ void main() {
51
63
'The name is too strange (strangeName is banned)' ,
52
64
'Oops (AnotherStrangeName is banned)' ,
53
65
'The name is too strange (strangeName is banned)' ,
66
+ 'Please use NonStrangeClass.someMethod instead (StrangeClass.someMethod is banned)' ,
67
+ 'Please use clock.now instead (DateTime.now is banned)' ,
68
+ 'Please use clock.now instead (DateTime.now is banned)' ,
69
+ 'Please use clock.now instead (DateTime.now is banned)' ,
54
70
],
55
71
);
56
72
});
0 commit comments