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

Unified Diff: test/pb_list_test.dart

Issue 1024553002: Fix analyzer warning / bug: Iterable was treated as if it has sublist() (Closed) Base URL: https://github.com/dart-lang/dart-protobuf.git@master
Patch Set: Added test for Iterable with less elements than `end-start` Created 5 years, 9 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 | « lib/src/protobuf/pb_list.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/pb_list_test.dart
diff --git a/test/pb_list_test.dart b/test/pb_list_test.dart
index 40a5b537a8810ac1895e751308c43926e573e564..ce9fa0905bbe409e46b1597682be972c419765f9 100755
--- a/test/pb_list_test.dart
+++ b/test/pb_list_test.dart
@@ -61,6 +61,21 @@ void main() {
lb2.removeRange(5, 8);
expect(lb2, [1, 2, 3, 9, 8, 9]);
+ expect(() => lb2.setRange(5, 7, [88, 99].take(2)), throwsRangeError);
+ expect(lb2, [1, 2, 3, 9, 8, 9]);
+
+ expect(() => lb2.setRange(5, 7, [88, 99].take(2), 1), throwsRangeError);
+ expect(lb2, [1, 2, 3, 9, 8, 9]);
+
+ expect(() => lb2.setRange(4, 6, [88, 99].take(1), 1), throwsStateError);
+ expect(lb2, [1, 2, 3, 9, 8, 9]);
+
+ lb2.setRange(5, 6, [88, 99].take(2));
+ expect(lb2, [1, 2, 3, 9, 8, 88]);
+
+ lb2.setRange(5, 6, [88, 99].take(2), 1);
+ expect(lb2, [1, 2, 3, 9, 8, 99]);
+
expect(() { (new PbList<int>() as dynamic).add('hello'); }, throws);
PbSint32List listSint32 = new PbSint32List();
« no previous file with comments | « lib/src/protobuf/pb_list.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698