blob: 57e7685b8d36c6a75f75248f9522c30eae765ad3 [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 @assertion LinkedHashMap<K, V> abstract class
/// implements HashMap<K, V>
/// The map allows [null] as a key.
/// @description Checks that [null] key works as expected.
/// @author
import "../../../Utils/expect.dart";
import "dart:collection";
main() {
LinkedHashMap map = new LinkedHashMap();
map[null] = 1;
Expect.equals(1, map[null]);
for (int i = 0; i < 100; i++) {
map[i] = i;
Expect.equals(1, map[null]);
map[null] = "testme";
Expect.equals("testme", map[null]);
Expect.equals(null, map[null]);