forked from tc39/test262
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tests for "Invalid Date" in more cases
Following the proposed specification in tc39/ecma262#848
- Loading branch information
Showing
3 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
test/built-ins/Date/prototype/toDateString/invalid-date.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (C) 2017 the V8 project authors. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-date.prototype.todatestring | ||
description: Invalid Dates are rendered as "Invalid Date" | ||
info: > | ||
Date.prototype.toDateString ( ) | ||
... | ||
3. If tv is NaN, return "Invalid Date". | ||
... | ||
---*/ | ||
|
||
assert.sameValue(new Date(NaN).toDateString(), "Invalid Date"); | ||
|
||
|
17 changes: 17 additions & 0 deletions
17
test/built-ins/Date/prototype/toTimeString/invalid-date.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (C) 2017 the V8 project authors. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-date.prototype.totimestring | ||
description: Invalid Dates are rendered as "Invalid Date" | ||
info: > | ||
Date.prototype.toTimeString ( ) | ||
... | ||
3. If tv is NaN, return "Invalid Date". | ||
... | ||
---*/ | ||
|
||
assert.sameValue(new Date(NaN).toTimeString(), "Invalid Date"); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright (C) 2017 the V8 project authors. All rights reserved. | ||
// This code is governed by the BSD license found in the LICENSE file. | ||
|
||
/*--- | ||
esid: sec-date.prototype.toutcstring | ||
description: Invalid Dates are rendered as "Invalid Date" | ||
info: > | ||
Date.prototype.toUTCString ( ) | ||
... | ||
3. If tv is NaN, return "Invalid Date". | ||
... | ||
---*/ | ||
|
||
assert.sameValue(new Date(NaN).toUTCString(), "Invalid Date"); | ||
|