@@ -115,7 +115,7 @@ void main() {
115115
116116 // basic tests on horizontal line
117117 final PathMetrics simpleHorizontalMetrics = simpleHorizontalLine.computeMetrics ();
118- expect (simpleHorizontalMetrics.iterator.current, isNull );
118+ expect (() => simpleHorizontalMetrics.iterator.current, throwsRangeError );
119119 expect (simpleHorizontalMetrics.iterator.moveNext (), isTrue);
120120 expect (simpleHorizontalMetrics.iterator.current, isNotNull);
121121 expect (simpleHorizontalMetrics.iterator.current.length, equals (10.0 ));
@@ -128,11 +128,11 @@ void main() {
128128 expect (posTan.angle, equals (0.0 ));
129129
130130 expect (simpleHorizontalMetrics.iterator.moveNext (), isFalse);
131- expect (simpleHorizontalMetrics.iterator.current, isNull );
131+ expect (() => simpleHorizontalMetrics.iterator.current, throwsRangeError );
132132
133133 // test with forceClosed
134134 final PathMetrics simpleMetricsClosed = simpleHorizontalLine.computeMetrics (forceClosed: true );
135- expect (simpleMetricsClosed .iterator.current, isNull );
135+ expect (() => simpleHorizontalMetrics .iterator.current, throwsRangeError );
136136 expect (simpleMetricsClosed.iterator.moveNext (), isTrue);
137137 expect (simpleMetricsClosed.iterator.current, isNotNull);
138138 expect (simpleMetricsClosed.iterator.current.length, equals (20.0 )); // because we forced close
@@ -163,15 +163,15 @@ void main() {
163163 ..lineTo (10.0 , 15.0 );
164164
165165 final PathMetrics multiContourMetric = multiContour.computeMetrics ();
166- expect (multiContourMetric.iterator.current, isNull );
166+ expect (() => multiContourMetric.iterator.current, throwsRangeError );
167167 expect (multiContourMetric.iterator.moveNext (), isTrue);
168168 expect (multiContourMetric.iterator.current, isNotNull);
169169 expect (multiContourMetric.iterator.current.length, equals (10.0 ));
170170 expect (multiContourMetric.iterator.moveNext (), isTrue);
171171 expect (multiContourMetric.iterator.current, isNotNull);
172172 expect (multiContourMetric.iterator.current.length, equals (5.0 ));
173173 expect (multiContourMetric.iterator.moveNext (), isFalse);
174- expect (multiContourMetric.iterator.current, isNull );
174+ expect (() => multiContourMetric.iterator.current, throwsRangeError );
175175 });
176176
177177 test ('PathMetrics can remember lengths and isClosed' , () {
0 commit comments