| Index: tests/corelib/uri_path_test.dart
|
| diff --git a/tests/corelib/uri_path_test.dart b/tests/corelib/uri_path_test.dart
|
| index bc62d3e1b3ee54756b33485be6fc2ce39170e91a..d956ebe8431380c29c7b026da8027a878d71f96c 100644
|
| --- a/tests/corelib/uri_path_test.dart
|
| +++ b/tests/corelib/uri_path_test.dart
|
| @@ -70,14 +70,50 @@ void testPathSegments() {
|
| }
|
| encoded = encoded.toString();
|
| unencoded = unencoded.toString();
|
| - print(encoded);
|
| - print(unencoded);
|
| test(encoded, [unencoded]);
|
| test(encoded + "/" + encoded, [unencoded, unencoded]);
|
| }
|
|
|
| +testPathSegmentsImmutableList() {
|
| + test(list) {
|
| + Expect.equals("a", list[0]);
|
| + Expect.throws(() => list[0] = "c", (e) => e is StateError);
|
| + Expect.equals(2, list.length);
|
| + Expect.throws(() => list.length = 1, (e) => e is StateError);
|
| + Expect.throws(() => list.add("c"), (e) => e is StateError);
|
| + Expect.throws(() => list.addAll(["c", "d"]), (e) => e is StateError);
|
| + Expect.listEquals(["b", "a"], list.reversed.toList());
|
| + Expect.throws(() => list.sort(), (e) => e is StateError);
|
| + Expect.equals(0, list.indexOf("a"));
|
| + Expect.equals(0, list.lastIndexOf("a"));
|
| + Expect.throws(() => list.clear(), (e) => e is StateError);
|
| + Expect.throws(() => list.insert(1, "c"), (e) => e is StateError);
|
| + Expect.throws(() => list.insertAll(1, ["c", "d"]), (e) => e is StateError);
|
| + Expect.throws(() => list.setAll(1, ["c", "d"]), (e) => e is StateError);
|
| + Expect.throws(() => list.remove("a"), (e) => e is StateError);
|
| + Expect.throws(() => list.removeAt(0), (e) => e is StateError);
|
| + Expect.throws(() => list.removeLast(), (e) => e is StateError);
|
| + Expect.throws(() => list.removeWhere((e) => true), (e) => e is StateError);
|
| + Expect.throws(() => list.retainWhere((e) => false), (e) => e is StateError);
|
| + Expect.listEquals(["a"], list.sublist(0, 1));
|
| + Expect.listEquals(["a"], list.getRange(0, 1).toList());
|
| + Expect.throws(() => list.setRange(0, 1, ["c"]), (e) => e is StateError);
|
| + Expect.throws(() => list.removeRange(0, 1), (e) => e is StateError);
|
| + Expect.throws(() => list.fillRange(0, 1, "c"), (e) => e is StateError);
|
| + Expect.throws(() => list.replaceRange(0, 1, ["c"]), (e) => e is StateError);
|
| + Map map = new Map();
|
| + map[0] = "a";
|
| + map[1] = "b";
|
| + Expect.mapEquals(list.asMap(), map);
|
| + }
|
| +
|
| + test(Uri.parse("a/b").pathSegments);
|
| + test(new Uri(pathSegments: ["a", "b"]).pathSegments);
|
| +}
|
| +
|
| main() {
|
| testInvalidArguments();
|
| testPath();
|
| testPathSegments();
|
| + testPathSegmentsImmutableList();
|
| }
|
|
|