// 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.

import "package:expect/expect.dart";

// Test program for the HashMap class.

class HashMapTest {

  static testMain() {
    var m = new Map();
    Expect.equals(0, m.length);
    Expect.equals(true, m.isEmpty);
    m["one"] = 1;
    Expect.equals(1, m.length);
    Expect.equals(false, m.isEmpty);
    Expect.equals(1, m["one"]);
  }
}

main() {
  HashMapTest.testMain();
}
