blob: bd9530639b9798ec394d6edb7031b1e6c50a2dd7 [file] [log] [blame]
// Copyright (c) 2011, 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 final E first
/// Returns the first element.
/// @description Checks that the first element of the list is returned.
/// @author kaigorodov
import "../../../Utils/expect.dart";
import "dart:collection";
import "LinkedList.lib.dart";
main() {
MyLinkedListEntry head = new MyLinkedListEntry("head");
LinkedList<MyLinkedListEntry> a = new LinkedList<MyLinkedListEntry>();
Expect.equals(0, a.length);
a.add(head);
Expect.equals(head, a.first);
a.add(new MyLinkedListEntry(1));
Expect.equals(head, a.first);
}