blob: b6bb43a616628d0b4c3b091e5018f160c5ca8994 [file] [log] [blame]
/*
* Copyright (c) 2013, 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 int hashCode
* Get a hash code for this object.
* All objects have hash codes. Hash codes are guaranteed to be the same for
* objects that are equal when compared using the equality operator ==.
* @description Checks that equals objects have equal hash codes and different
* objects have different hash codes.
* @author msyabro
*/
import "dart:typed_data";
import "../../../Utils/expect.dart";
main() {
var obj1 = new Float32x4List(0);
var obj2 = new Float32x4List(0);
var obj3 = obj1;
Expect.isTrue(obj1.hashCode == obj3.hashCode);
Expect.isTrue(obj1.hashCode == obj1.hashCode);
Expect.isFalse(obj2.hashCode == obj3.hashCode);
Expect.isFalse(obj1.hashCode == obj2.hashCode);
}