blob: 4893ae4a9cb041055ff54ae5640cc5c22e5fbb2e [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 int indexOf(E element, [int start = 0])
* Returns [-1] if given [element] is not found.
* @description Checks that [-1] is returned, if the [element] presents in the
* list and [start] index is more than maximum [element] position
* @author iarkh@unipro.ru
*/
import "dart:collection";
import "../../../Utils/expect.dart";
main() {
UnmodifiableListView a =
new UnmodifiableListView([42, 0, -1, 42, -1, 6031769, 0]);
Expect.equals(-1, a.indexOf(42, 5));
Expect.equals(-1, a.indexOf(0, 8));
Expect.equals(-1, a.indexOf(-1, 5));
Expect.equals(-1, a.indexOf(86031769, 6));
}