mirror of https://github.com/tc39/test262.git
Add tests for non-optional arguments of Date.UTC()
This commit is contained in:
parent
81f66a5a3a
commit
b77714514e
|
@ -17,10 +17,13 @@ info: |
|
|||
9. Return TimeClip(MakeDate(MakeDay(yr, m, dt), MakeTime(h, min, s, milli))).
|
||||
---*/
|
||||
|
||||
assert.sameValue(new Date(NaN, 0).getTime(), NaN, 'year');
|
||||
assert.sameValue(new Date(1970, NaN).getTime(), NaN, 'month');
|
||||
assert.sameValue(new Date(1970, 0, NaN).getTime(), NaN, 'date');
|
||||
assert.sameValue(new Date(1970, 0, 1, NaN).getTime(), NaN, 'hours');
|
||||
assert.sameValue(new Date(1970, 0, 1, 0, NaN).getTime(), NaN, 'minutes');
|
||||
assert.sameValue(new Date(1970, 0, 1, 0, 0, NaN).getTime(), NaN, 'seconds');
|
||||
assert.sameValue(new Date(1970, 0, 1, 0, 0, 0, NaN).getTime(), NaN, 'ms');
|
||||
assert.sameValue(Date.UTC(NaN, 0), NaN, 'year');
|
||||
assert.sameValue(Date.UTC(1970, NaN), NaN, 'month');
|
||||
assert.sameValue(Date.UTC(1970, 0, NaN), NaN, 'date');
|
||||
assert.sameValue(Date.UTC(1970, 0, 1, NaN), NaN, 'hours');
|
||||
assert.sameValue(Date.UTC(1970, 0, 1, 0, NaN), NaN, 'minutes');
|
||||
assert.sameValue(Date.UTC(1970, 0, 1, 0, 0, NaN), NaN, 'seconds');
|
||||
assert.sameValue(Date.UTC(1970, 0, 1, 0, 0, 0, NaN), NaN, 'ms');
|
||||
|
||||
// Tests for non optional arguments
|
||||
assert.sameValue(Date.UTC(), NaN, 'missing year');
|
||||
|
|
|
@ -17,6 +17,8 @@ info: |
|
|||
9. Return TimeClip(MakeDate(MakeDay(yr, m, dt), MakeTime(h, min, s, milli))).
|
||||
---*/
|
||||
|
||||
assert.sameValue(Date.UTC(1970), 0, '1970');
|
||||
|
||||
assert.sameValue(Date.UTC(1970, 0), 0, '1970, 0');
|
||||
assert.sameValue(Date.UTC(2016, 0), 1451606400000, '2016, 0');
|
||||
assert.sameValue(Date.UTC(2016, 6), 1467331200000, '2016, 6');
|
||||
|
|
Loading…
Reference in New Issue