blob: 842bf0d4b95c5dfee3734bd8ede696667c89a2c5 [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.
/// @assertion LinkedHashMap.from(Map other)
/// Creates a [LinkedHashMap<K,V>] that contains all key value pairs of [other].
/// @description Checks that created hash map contains all elements of [other].
/// Both empty and non-empty argument maps are tested.
/// @author msyabro
import "../../../Utils/expect.dart";
import "dart:collection";
check(Map m1, Map m2) {
Expect.equals(m1.length, m2.length);
m1.forEach((var key, var value) {
Expect.equals(value, m2[key]);
main() {
Map m = {"1": 1, "2": 2, "3": 3, "4": 4};
LinkedHashMap map = new LinkedHashMap.from(m);
check(m, map);
m = new Map();
map = new LinkedHashMap.from(m);