S15.10.2.6_A6_T2.js (1075B)
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: Assertions in combination 6 es5id: 15.10.2.6_A6_T2 7 description: Execute /^.*?/.exec("Hello World") and check results 8 ---*/ 9 10 var __executed = /^.*?/.exec("Hello World"); 11 12 var __expected = [""]; 13 __expected.index = 0; 14 __expected.input = "Hello World"; 15 16 assert.sameValue( 17 __executed.length, 18 __expected.length, 19 'The value of __executed.length is expected to equal the value of __expected.length' 20 ); 21 22 assert.sameValue( 23 __executed.index, 24 __expected.index, 25 'The value of __executed.index is expected to equal the value of __expected.index' 26 ); 27 28 assert.sameValue( 29 __executed.input, 30 __expected.input, 31 'The value of __executed.input is expected to equal the value of __expected.input' 32 ); 33 34 for(var index=0; index<__expected.length; index++) { 35 assert.sameValue( 36 __executed[index], 37 __expected[index], 38 'The value of __executed[index] is expected to equal the value of __expected[index]' 39 ); 40 } 41 42 reportCompare(0, 0);