Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(527)

Unified Diff: tests/lib/typed_data/typed_list_iterable_test.dart

Issue 2004823002: Fix typed_data_iterable_test to not assume 0 can be added to toList result. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/typed_data/typed_list_iterable_test.dart
diff --git a/tests/lib/typed_data/typed_list_iterable_test.dart b/tests/lib/typed_data/typed_list_iterable_test.dart
index acdfa4ba8ab41a4b2c80c7f0c86b89a3ceb213d2..787bfec7868f86712b16a8d4e9c641f12add23bf 100644
--- a/tests/lib/typed_data/typed_list_iterable_test.dart
+++ b/tests/lib/typed_data/typed_list_iterable_test.dart
@@ -153,10 +153,11 @@ void emptyChecks(list) {
Expect.isTrue(list.takeWhile((x) => true).isEmpty);
Expect.isTrue(list.toList().isEmpty);
var l2 = list.toList();
- l2.add(0);
- Expect.equals(0, l2.last);
+ var sampleValue = list is List<int> ? 0 : 0.0;
+ l2.add(sampleValue);
+ Expect.equals(sampleValue, l2.last);
var l3 = list.toList(growable: false);
- Expect.throws(() => l3.add(0), (e) => e is UnsupportedError);
+ Expect.throws(() => l3.add(sampleValue), (e) => e is UnsupportedError);
}
main() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698