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

Unified Diff: tests/compiler/dart2js/link_test.dart

Issue 11778039: Report arity errors on user definable operators. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments + Link test updated. Created 7 years, 11 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 | « tests/co19/co19-dart2js.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/link_test.dart
diff --git a/tests/compiler/dart2js/link_test.dart b/tests/compiler/dart2js/link_test.dart
index 7dafb45252ea21a3919900d4ddc66a422d9de17d..b050ee89f5d2b633d2b5feb64d404170ef0d2480 100644
--- a/tests/compiler/dart2js/link_test.dart
+++ b/tests/compiler/dart2js/link_test.dart
@@ -19,6 +19,7 @@ main() {
testFromList([0, 1, 2, 3]);
testFromList([0, 1, 2, 3, 4]);
testFromList([0, 1, 2, 3, 4, 5]);
+ testSkip();
}
testFromList(List list) {
@@ -44,3 +45,18 @@ test(Link link, List list) {
Expect.equals(list.length, i);
Expect.isTrue(link.isEmpty);
}
+
+testSkip() {
+ var nonEmptyLink = new Link.fromList([0, 1, 2, 3, 4, 5]);
+ for (int i = 0 ; i < 5; i++) {
+ var link = nonEmptyLink.skip(i);
+ Expect.isFalse(link.isEmpty);
+ Expect.equals(i, link.head);
+ }
+ Expect.isTrue(nonEmptyLink.skip(6).isEmpty);
+ Expect.throws(() => nonEmptyLink.skip(7), (e) => e is RangeError);
+
+ var emptyLink = const Link();
+ Expect.isTrue(emptyLink.skip(0).isEmpty);
+ Expect.throws(() => emptyLink.skip(1), (e) => e is RangeError);
+}
« no previous file with comments | « tests/co19/co19-dart2js.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698