blob: 95636a71ae512ce8fb7fd81d9c8caae29880675c [file] [log] [blame]
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/**
* @assertion void clear()
* This operation is not supported by an unmodifiable list.
* @description Checks that [clear] method is not supported.
* @author iarkh@unipro.ru
*/
import "dart:collection";
import "../../../Utils/expect.dart";
main() {
UnmodifiableListView l = new UnmodifiableListView([1, 2, 3, 4, 5]);
Expect.throws(() { l.clear(); }, (e) => e is UnsupportedError);
l = new UnmodifiableListView([]);
Expect.throws(() { l.clear(); }, (e) => e is UnsupportedError);
}