blob: 8bfb8a06997b1311be360d4b2b8138b4daeab99d [file] [log] [blame]
// Copyright (c) 2016, 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.
// @dart = 2.9
/// @assertion void insertAfter(E entry)
/// Insert an element after this element in this element's linked list.
/// @description Checks that entry is inserted after this element. Try to add
/// entry after the last element
/// @author
import "dart:collection";
import "../../../Utils/expect.dart";
import "LinkedListEntry.lib.dart";
main() {
LinkedList<MyLinkedListEntry> list = new LinkedList<MyLinkedListEntry<int>>();
MyLinkedListEntry<int> entry1 = new MyLinkedListEntry<int>(1);
MyLinkedListEntry<int> entry2 = new MyLinkedListEntry<int>(2);
MyLinkedListEntry<int> entry3 = new MyLinkedListEntry<int>(2);
Expect.identical(list, entry3.list);
Expect.identical(entry2, entry3.previous);
Expect.identical(entry3, list.last);