michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: michael@0: /** michael@0: File Name: 11.8.4.js michael@0: ECMA Section: 11.8.4 The greater-than-or-equal operator ( >= ) michael@0: Description: michael@0: michael@0: michael@0: Author: christine@netscape.com michael@0: Date: 12 november 1997 michael@0: */ michael@0: var SECTION = "11.8.4"; michael@0: var VERSION = "ECMA_1"; michael@0: startTest(); michael@0: michael@0: writeHeaderToLog( SECTION + " The greater-than-or-equal operator ( >= )"); michael@0: michael@0: new TestCase( SECTION, "true >= false", true, true >= false ); michael@0: new TestCase( SECTION, "false >= true", false, false >= true ); michael@0: new TestCase( SECTION, "false >= false", true, false >= false ); michael@0: new TestCase( SECTION, "true >= true", true, true >= true ); michael@0: michael@0: new TestCase( SECTION, "new Boolean(true) >= new Boolean(true)", true, new Boolean(true) >= new Boolean(true) ); michael@0: new TestCase( SECTION, "new Boolean(true) >= new Boolean(false)", true, new Boolean(true) >= new Boolean(false) ); michael@0: new TestCase( SECTION, "new Boolean(false) >= new Boolean(true)", false, new Boolean(false) >= new Boolean(true) ); michael@0: new TestCase( SECTION, "new Boolean(false) >= new Boolean(false)", true, new Boolean(false) >= new Boolean(false) ); michael@0: michael@0: new TestCase( SECTION, "new MyObject(Infinity) >= new MyObject(Infinity)", true, new MyObject( Number.POSITIVE_INFINITY ) >= new MyObject( Number.POSITIVE_INFINITY) ); michael@0: new TestCase( SECTION, "new MyObject(-Infinity) >= new MyObject(Infinity)", false, new MyObject( Number.NEGATIVE_INFINITY ) >= new MyObject( Number.POSITIVE_INFINITY) ); michael@0: new TestCase( SECTION, "new MyObject(-Infinity) >= new MyObject(-Infinity)", true, new MyObject( Number.NEGATIVE_INFINITY ) >= new MyObject( Number.NEGATIVE_INFINITY) ); michael@0: michael@0: new TestCase( SECTION, "new MyValueObject(false) >= new MyValueObject(true)", false, new MyValueObject(false) >= new MyValueObject(true) ); michael@0: new TestCase( SECTION, "new MyValueObject(true) >= new MyValueObject(true)", true, new MyValueObject(true) >= new MyValueObject(true) ); michael@0: new TestCase( SECTION, "new MyValueObject(false) >= new MyValueObject(false)", true, new MyValueObject(false) >= new MyValueObject(false) ); michael@0: michael@0: new TestCase( SECTION, "new MyStringObject(false) >= new MyStringObject(true)", false, new MyStringObject(false) >= new MyStringObject(true) ); michael@0: new TestCase( SECTION, "new MyStringObject(true) >= new MyStringObject(true)", true, new MyStringObject(true) >= new MyStringObject(true) ); michael@0: new TestCase( SECTION, "new MyStringObject(false) >= new MyStringObject(false)", true, new MyStringObject(false) >= new MyStringObject(false) ); michael@0: michael@0: new TestCase( SECTION, "Number.NaN >= Number.NaN", false, Number.NaN >= Number.NaN ); michael@0: new TestCase( SECTION, "0 >= Number.NaN", false, 0 >= Number.NaN ); michael@0: new TestCase( SECTION, "Number.NaN >= 0", false, Number.NaN >= 0 ); michael@0: michael@0: new TestCase( SECTION, "0 >= -0", true, 0 >= -0 ); michael@0: new TestCase( SECTION, "-0 >= 0", true, -0 >= 0 ); michael@0: michael@0: new TestCase( SECTION, "Infinity >= 0", true, Number.POSITIVE_INFINITY >= 0 ); michael@0: new TestCase( SECTION, "Infinity >= Number.MAX_VALUE", true, Number.POSITIVE_INFINITY >= Number.MAX_VALUE ); michael@0: new TestCase( SECTION, "Infinity >= Infinity", true, Number.POSITIVE_INFINITY >= Number.POSITIVE_INFINITY ); michael@0: michael@0: new TestCase( SECTION, "0 >= Infinity", false, 0 >= Number.POSITIVE_INFINITY ); michael@0: new TestCase( SECTION, "Number.MAX_VALUE >= Infinity", false, Number.MAX_VALUE >= Number.POSITIVE_INFINITY ); michael@0: michael@0: new TestCase( SECTION, "0 >= -Infinity", true, 0 >= Number.NEGATIVE_INFINITY ); michael@0: new TestCase( SECTION, "Number.MAX_VALUE >= -Infinity", true, Number.MAX_VALUE >= Number.NEGATIVE_INFINITY ); michael@0: new TestCase( SECTION, "-Infinity >= -Infinity", true, Number.NEGATIVE_INFINITY >= Number.NEGATIVE_INFINITY ); michael@0: michael@0: new TestCase( SECTION, "-Infinity >= 0", false, Number.NEGATIVE_INFINITY >= 0 ); michael@0: new TestCase( SECTION, "-Infinity >= -Number.MAX_VALUE", false, Number.NEGATIVE_INFINITY >= -Number.MAX_VALUE ); michael@0: new TestCase( SECTION, "-Infinity >= Number.MIN_VALUE", false, Number.NEGATIVE_INFINITY >= Number.MIN_VALUE ); michael@0: michael@0: new TestCase( SECTION, "'string' > 'string'", false, 'string' > 'string' ); michael@0: new TestCase( SECTION, "'astring' > 'string'", false, 'astring' > 'string' ); michael@0: new TestCase( SECTION, "'strings' > 'stringy'", false, 'strings' > 'stringy' ); michael@0: new TestCase( SECTION, "'strings' > 'stringier'", true, 'strings' > 'stringier' ); michael@0: new TestCase( SECTION, "'string' > 'astring'", true, 'string' > 'astring' ); michael@0: new TestCase( SECTION, "'string' > 'strings'", false, 'string' > 'strings' ); michael@0: michael@0: test(); michael@0: michael@0: function MyObject(value) { michael@0: this.value = value; michael@0: this.valueOf = new Function( "return this.value" ); michael@0: this.toString = new Function( "return this.value +''" ); michael@0: } michael@0: function MyValueObject(value) { michael@0: this.value = value; michael@0: this.valueOf = new Function( "return this.value" ); michael@0: } michael@0: function MyStringObject(value) { michael@0: this.value = value; michael@0: this.toString = new Function( "return this.value +''" ); michael@0: }