S11.8.1_A4.12_T2.js (1100B)
1 // Copyright 2009 the Sputnik authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 info: | 6 If neither x, nor y is a prefix of each other, returned result of strings 7 comparison applies a simple lexicographic ordering to the sequences of 8 code unit value values 9 es5id: 11.8.1_A4.12_T2 10 description: x and y are string primitives 11 ---*/ 12 13 //CHECK#1 14 if (("0" < "x") !== true) { 15 throw new Test262Error('#1: ("0" < "x") !== true'); 16 } 17 18 //CHECK#2 19 if (("-" < "0") !== true) { 20 throw new Test262Error('#2: ("-" < "0") !== true'); 21 } 22 23 //CHECK#3 24 if (("." < "0") !== true) { 25 throw new Test262Error('#3: ("." < "0") !== true'); 26 } 27 28 //CHECK#4 29 if (("+" < "-") !== true) { 30 throw new Test262Error('#4: ("+" < "-") !== true'); 31 } 32 33 //CHECK#5 34 if (("-0" < "-1") !== true) { 35 throw new Test262Error('#5: ("-0" < "-1") !== true'); 36 } 37 38 //CHECK#6 39 if (("+1" < "-1") !== true) { 40 throw new Test262Error('#6: ("+1" < "-1") !== true'); 41 } 42 43 //CHECK#7 44 if (("1" < "1e-10") !== true) { 45 throw new Test262Error('#7: ("1" < "1e-10") !== true'); 46 } 47 48 reportCompare(0, 0);