tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

S15.10.2.8_A2_T5.js (1382B)


      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    The form (?! Disjunction ) specifies a zero-width negative lookahead.
      7    In order for it to succeed, the pattern inside Disjunction must fail to match at the current position.
      8    The current position is not advanced before matching the sequel
      9 es5id: 15.10.2.8_A2_T5
     10 description: >
     11    Execute /Java(?!Script)([A-Z]\w*)/.exec("JavaScr oops ipt ") and
     12    check results
     13 ---*/
     14 
     15 var __executed = /Java(?!Script)([A-Z]\w*)/.exec("JavaScr oops ipt ");
     16 
     17 var __expected = ["JavaScr", "Scr"];
     18 __expected.index = 0;
     19 __expected.input = "JavaScr oops ipt ";
     20 
     21 assert.sameValue(
     22  __executed.length,
     23  __expected.length,
     24  'The value of __executed.length is expected to equal the value of __expected.length'
     25 );
     26 
     27 assert.sameValue(
     28  __executed.index,
     29  __expected.index,
     30  'The value of __executed.index is expected to equal the value of __expected.index'
     31 );
     32 
     33 assert.sameValue(
     34  __executed.input,
     35  __expected.input,
     36  'The value of __executed.input is expected to equal the value of __expected.input'
     37 );
     38 
     39 for(var index=0; index<__expected.length; index++) {
     40  assert.sameValue(
     41    __executed[index],
     42    __expected[index],
     43    'The value of __executed[index] is expected to equal the value of __expected[index]'
     44  );
     45 }
     46 
     47 reportCompare(0, 0);