tor-browser

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

exhaustive.js (4525B)


      1 // |reftest| skip-if(!this.hasOwnProperty('Temporal')) -- Temporal is not enabled unconditionally
      2 // Copyright (C) 2023 Igalia, S.L. All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 
      5 /*---
      6 esid: sec-temporal.plaindatetime.compare
      7 description: Tests for compare() with each possible outcome
      8 features: [Temporal]
      9 ---*/
     10 
     11 assert.sameValue(
     12  Temporal.PlainDateTime.compare(
     13    new Temporal.PlainDateTime(2000, 5, 31, 12, 15, 45, 333, 777, 111),
     14    new Temporal.PlainDateTime(1987, 5, 31, 12, 15, 45, 333, 777, 111)
     15  ),
     16  1,
     17  "year >"
     18 );
     19 assert.sameValue(
     20  Temporal.PlainDateTime.compare(
     21    new Temporal.PlainDateTime(1981, 12, 15, 6, 30, 15, 222, 444, 6),
     22    new Temporal.PlainDateTime(2048, 12, 15, 6, 30, 15, 222, 444, 6)
     23  ),
     24  -1,
     25  "year <"
     26 );
     27 assert.sameValue(
     28  Temporal.PlainDateTime.compare(
     29    new Temporal.PlainDateTime(2000, 5, 31, 12, 15, 45, 333, 777, 111),
     30    new Temporal.PlainDateTime(2000, 3, 31, 12, 15, 45, 333, 777, 111)
     31  ),
     32  1,
     33  "month >"
     34 );
     35 assert.sameValue(
     36  Temporal.PlainDateTime.compare(
     37    new Temporal.PlainDateTime(1981, 4, 15, 6, 30, 15, 222, 444, 6),
     38    new Temporal.PlainDateTime(1981, 12, 15, 6, 30, 15, 222, 444, 6)
     39  ),
     40  -1,
     41  "month <"
     42 );
     43 assert.sameValue(
     44  Temporal.PlainDateTime.compare(
     45    new Temporal.PlainDateTime(2000, 5, 31, 12, 15, 45, 333, 777, 111),
     46    new Temporal.PlainDateTime(2000, 5, 14, 12, 15, 45, 333, 777, 111)
     47  ),
     48  1,
     49  "day >"
     50 );
     51 assert.sameValue(
     52  Temporal.PlainDateTime.compare(
     53    new Temporal.PlainDateTime(1981, 4, 15, 6, 30, 15, 222, 444, 6),
     54    new Temporal.PlainDateTime(1981, 4, 21, 6, 30, 15, 222, 444, 6)
     55  ),
     56  -1,
     57  "day <"
     58 );
     59 assert.sameValue(
     60  Temporal.PlainDateTime.compare(
     61    new Temporal.PlainDateTime(2000, 5, 31, 12, 15, 45, 333, 777, 111),
     62    new Temporal.PlainDateTime(2000, 5, 31, 6, 15, 45, 333, 777, 111)
     63  ),
     64  1,
     65  "hour >"
     66 );
     67 assert.sameValue(
     68  Temporal.PlainDateTime.compare(
     69    new Temporal.PlainDateTime(1981, 4, 15, 6, 30, 15, 222, 444, 6),
     70    new Temporal.PlainDateTime(1981, 4, 15, 22, 30, 15, 222, 444, 6)
     71  ),
     72  -1,
     73  "hour <"
     74 );
     75 assert.sameValue(
     76  Temporal.PlainDateTime.compare(
     77    new Temporal.PlainDateTime(2000, 5, 31, 12, 15, 45, 333, 777, 111),
     78    new Temporal.PlainDateTime(2000, 5, 31, 12, 15, 22, 333, 777, 111)
     79  ),
     80  1,
     81  "minute >"
     82 );
     83 assert.sameValue(
     84  Temporal.PlainDateTime.compare(
     85    new Temporal.PlainDateTime(1981, 4, 15, 6, 30, 15, 222, 444, 6),
     86    new Temporal.PlainDateTime(1981, 4, 15, 6, 57, 15, 222, 444, 6)
     87  ),
     88  -1,
     89  "minute <"
     90 );
     91 assert.sameValue(
     92  Temporal.PlainDateTime.compare(
     93    new Temporal.PlainDateTime(2000, 5, 31, 12, 15, 6, 333, 777, 111),
     94    new Temporal.PlainDateTime(2000, 5, 31, 12, 15, 5, 333, 777, 111)
     95  ),
     96  1,
     97  "second >"
     98 );
     99 assert.sameValue(
    100  Temporal.PlainDateTime.compare(
    101    new Temporal.PlainDateTime(1981, 4, 15, 6, 30, 3, 222, 444, 6),
    102    new Temporal.PlainDateTime(1981, 4, 15, 6, 30, 4, 222, 444, 6)
    103  ),
    104  -1,
    105  "second <"
    106 );
    107 assert.sameValue(
    108  Temporal.PlainDateTime.compare(
    109    new Temporal.PlainDateTime(2000, 5, 31, 12, 15, 45, 6, 777, 111),
    110    new Temporal.PlainDateTime(2000, 5, 31, 12, 15, 45, 5, 777, 111)
    111  ),
    112  1,
    113  "millisecond >"
    114 );
    115 assert.sameValue(
    116  Temporal.PlainDateTime.compare(
    117    new Temporal.PlainDateTime(1981, 4, 15, 6, 30, 15, 3, 444, 6),
    118    new Temporal.PlainDateTime(1981, 4, 15, 6, 30, 15, 4, 444, 6)
    119  ),
    120  -1,
    121  "millisecond <"
    122 );
    123 assert.sameValue(
    124  Temporal.PlainDateTime.compare(
    125    new Temporal.PlainDateTime(2000, 5, 31, 12, 15, 45, 333, 6, 111),
    126    new Temporal.PlainDateTime(2000, 5, 31, 12, 15, 45, 333, 5, 111)
    127  ),
    128  1,
    129  "microsecond >"
    130 );
    131 assert.sameValue(
    132  Temporal.PlainDateTime.compare(
    133    new Temporal.PlainDateTime(1981, 4, 15, 6, 30, 15, 222, 3, 6),
    134    new Temporal.PlainDateTime(1981, 4, 15, 6, 30, 15, 222, 4, 6)
    135  ),
    136  -1,
    137  "microsecond <"
    138 );
    139 assert.sameValue(
    140  Temporal.PlainDateTime.compare(
    141    new Temporal.PlainDateTime(2000, 5, 31, 12, 15, 45, 333, 777, 999),
    142    new Temporal.PlainDateTime(2000, 5, 31, 12, 15, 45, 333, 777, 111)
    143  ),
    144  1,
    145  "nanosecond >"
    146 );
    147 assert.sameValue(
    148  Temporal.PlainDateTime.compare(
    149    new Temporal.PlainDateTime(1981, 4, 15, 6, 30, 15, 222, 444, 0),
    150    new Temporal.PlainDateTime(1981, 4, 15, 6, 30, 15, 222, 444, 6)
    151  ),
    152  -1,
    153  "nanosecond <"
    154 );
    155 assert.sameValue(
    156  Temporal.PlainDateTime.compare(
    157    new Temporal.PlainDateTime(2000, 5, 31, 12, 15, 45, 333, 777, 111),
    158    new Temporal.PlainDateTime(2000, 5, 31, 12, 15, 45, 333, 777, 111)
    159  ),
    160  0,
    161  "="
    162 );
    163 
    164 reportCompare(0, 0);