window.GlobalErrors = [];
Array.prototype.equals = (function (otherArray) {
if (!otherArray || len !== otherArray.length) return false;
for (var i = 0; i < len; i++) {
if (array[i] && otherArray[i] && array[i].equals && otherArray[i].equals) {
if (!array[i].equals(otherArray[i])) {
if (array[i] != otherArray[i]) return false;
Object.subclass("TestCase", {
assert: function (bool, msg) {
throw new Error("Assertion failed " + msg);
assertEquals: function (left, right, msg) {
throw new Error("Expected " + left + " and " + right + " to be equal. " +
msg);
assertEqualsEpsilon: function(a, b, msg) {
if (Math.abs(a-b) <= eps) return;
this.assert(false, (msg ? msg : '') + ' (' + a +' != ' + b +')');