| 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);
|
| +}
|
|
|