@@ -88,32 +88,45 @@ void main() {
88
88
// when the feature is enabled by default.
89
89
group ('Experiments' , () {
90
90
Library main;
91
- TopLevelVariable aComplexSet, inferredTypeSet, specifiedSet, untypedMap, typedSet;
91
+ TopLevelVariable aComplexSet,
92
+ inferredTypeSet,
93
+ specifiedSet,
94
+ untypedMap,
95
+ typedSet;
92
96
93
97
setUpAll (() {
94
- main = packageGraphExperiments.libraries.firstWhere ((lib) => lib.name == 'main' );
98
+ main = packageGraphExperiments.libraries
99
+ .firstWhere ((lib) => lib.name == 'main' );
95
100
aComplexSet = main.constants.firstWhere ((v) => v.name == 'aComplexSet' );
96
- inferredTypeSet = main.constants.firstWhere ((v) => v.name == 'inferredTypeSet' );
101
+ inferredTypeSet =
102
+ main.constants.firstWhere ((v) => v.name == 'inferredTypeSet' );
97
103
specifiedSet = main.constants.firstWhere ((v) => v.name == 'specifiedSet' );
98
104
untypedMap = main.constants.firstWhere ((v) => v.name == 'untypedMap' );
99
105
typedSet = main.constants.firstWhere ((v) => v.name == 'typedSet' );
100
106
});
101
107
102
108
test ('Set literals test' , () {
103
109
expect (aComplexSet.modelType.name, equals ('Set' ));
104
- expect (aComplexSet.modelType.typeArguments.map ((a) => a.name).toList (), equals (['AClassContainingLiterals' ]));
105
- expect (aComplexSet.constantValue, equals ('const {const AClassContainingLiterals(3, 5)}' ));
110
+ expect (aComplexSet.modelType.typeArguments.map ((a) => a.name).toList (),
111
+ equals (['AClassContainingLiterals' ]));
112
+ expect (aComplexSet.constantValue,
113
+ equals ('const {const AClassContainingLiterals(3, 5)}' ));
106
114
expect (inferredTypeSet.modelType.name, equals ('Set' ));
107
- expect (inferredTypeSet.modelType.typeArguments.map ((a) => a.name).toList (), equals (['num' ]));
115
+ expect (
116
+ inferredTypeSet.modelType.typeArguments.map ((a) => a.name).toList (),
117
+ equals (['num' ]));
108
118
expect (inferredTypeSet.constantValue, equals ('const {1, 2.5, 3}' ));
109
119
expect (specifiedSet.modelType.name, equals ('Set' ));
110
- expect (specifiedSet.modelType.typeArguments.map ((a) => a.name).toList (), equals (['int' ]));
120
+ expect (specifiedSet.modelType.typeArguments.map ((a) => a.name).toList (),
121
+ equals (['int' ]));
111
122
expect (specifiedSet.constantValue, equals ('const {}' ));
112
123
expect (untypedMap.modelType.name, equals ('Map' ));
113
- expect (untypedMap.modelType.typeArguments.map ((a) => a.name).toList (), equals (['dynamic' , 'dynamic' ]));
124
+ expect (untypedMap.modelType.typeArguments.map ((a) => a.name).toList (),
125
+ equals (['dynamic' , 'dynamic' ]));
114
126
expect (untypedMap.constantValue, equals ('const {}' ));
115
127
expect (typedSet.modelType.name, equals ('Set' ));
116
- expect (typedSet.modelType.typeArguments.map ((a) => a.name).toList (), equals (['String' ]));
128
+ expect (typedSet.modelType.typeArguments.map ((a) => a.name).toList (),
129
+ equals (['String' ]));
117
130
expect (typedSet.constantValue, equals ('const <String> {}' ));
118
131
});
119
132
});
@@ -128,7 +141,8 @@ void main() {
128
141
Method invokeToolNonCanonical, invokeToolNonCanonicalSubclass;
129
142
Method invokeToolPrivateLibrary, invokeToolPrivateLibraryOriginal;
130
143
Method invokeToolParentDoc, invokeToolParentDocOriginal;
131
- final RegExp packageInvocationIndexRegexp = new RegExp (r'PACKAGE_INVOCATION_INDEX: (\d+)' );
144
+ final RegExp packageInvocationIndexRegexp =
145
+ new RegExp (r'PACKAGE_INVOCATION_INDEX: (\d+)' );
132
146
133
147
setUpAll (() {
134
148
_NonCanonicalToolUser = fakeLibrary.allClasses
@@ -165,13 +179,16 @@ void main() {
165
179
packageGraph.allLocalModelElements.forEach ((m) => m.documentation);
166
180
});
167
181
168
- test ('invokes tool when inherited documentation is the only means for it to be seen' , () {
182
+ test (
183
+ 'invokes tool when inherited documentation is the only means for it to be seen' ,
184
+ () {
169
185
// Verify setup of the test is correct.
170
186
expect (invokeToolParentDoc.isCanonical, isTrue);
171
187
expect (invokeToolParentDoc.documentationComment, isNull);
172
188
// Error message here might look strange due to toString() on Methods, but if this
173
189
// fails that means we don't have the correct invokeToolParentDoc instance.
174
- expect (invokeToolParentDoc.documentationFrom, contains (invokeToolParentDocOriginal));
190
+ expect (invokeToolParentDoc.documentationFrom,
191
+ contains (invokeToolParentDocOriginal));
175
192
// Tool should be substituted out here.
176
193
expect (invokeToolParentDoc.documentation, isNot (contains ('{@tool' )));
177
194
});
@@ -187,18 +204,20 @@ void main() {
187
204
equals (packageInvocationIndexRegexp
188
205
.firstMatch (invokeToolNonCanonicalSubclass.documentation)
189
206
.group (1 )));
190
- expect (invokeToolPrivateLibrary.documentation, isNot (contains ('{@tool' )));
207
+ expect (
208
+ invokeToolPrivateLibrary.documentation, isNot (contains ('{@tool' )));
191
209
expect (
192
210
invokeToolPrivateLibraryOriginal.documentation, contains ('{@tool' ));
193
211
});
194
212
195
213
test ('Documentation borrowed from implementer case' , () {
196
- expect (packageInvocationIndexRegexp
197
- .firstMatch (invokeToolParentDoc.documentation)
198
- .group (1 ),
199
- equals (packageInvocationIndexRegexp
200
- .firstMatch (invokeToolParentDocOriginal.documentation)
201
- .group (1 )));
214
+ expect (
215
+ packageInvocationIndexRegexp
216
+ .firstMatch (invokeToolParentDoc.documentation)
217
+ .group (1 ),
218
+ equals (packageInvocationIndexRegexp
219
+ .firstMatch (invokeToolParentDocOriginal.documentation)
220
+ .group (1 )));
202
221
});
203
222
});
204
223
0 commit comments