blob: a71d40fc6dc01faa81d448096876b3199f48c292 [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.
// @dart = 2.9
/// @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 iarkh@unipro.ru
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]);
map.remove(null);
Expect.equals(null, map[null]);
}