Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Unified Diff: test/intl/date-format/parse-mdyhms.js

Issue 1988073003: Fix Intl*parsing test (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: add // Flags: --intl-extra Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/intl/date-format/parse-MMMdy.js ('k') | test/intl/intl.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/intl/date-format/parse-mdyhms.js
diff --git a/test/intl/date-format/parse-mdyhms.js b/test/intl/date-format/parse-mdyhms.js
index 73efb620538edeea1b70f712381bb54f56f5e2d8..766f7192fe09935d76cd6a2841c22f2446971aad 100644
--- a/test/intl/date-format/parse-mdyhms.js
+++ b/test/intl/date-format/parse-mdyhms.js
@@ -26,6 +26,8 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Testing v8Parse method for date and time pattern.
+//
+// Flags: --intl-extra
var dtf = new Intl.DateTimeFormat(['en'],
{year: 'numeric', month: 'numeric',
@@ -34,7 +36,7 @@ var dtf = new Intl.DateTimeFormat(['en'],
timeZone: 'UTC'});
// Make sure we have pattern we expect (may change in the future).
-assertEquals('M/d/y h:mm:ss a', dtf.resolved.pattern);
+assertEquals('M/d/y, h:mm:ss a', dtf.resolved.pattern);
var date = dtf.v8Parse('2/4/74 12:30:42 pm');
assertEquals(1974, date.getUTCFullYear());
@@ -44,14 +46,20 @@ assertEquals(12, date.getUTCHours());
assertEquals(30, date.getUTCMinutes());
assertEquals(42, date.getUTCSeconds());
+// Can deal with '-' vs '/'.
+date = dtf.v8Parse('2-4-74 12:30:42 am');
+assertEquals(1974, date.getUTCFullYear());
+assertEquals(1, date.getUTCMonth());
+assertEquals(4, date.getUTCDate());
+assertEquals(0, date.getUTCHours());
+assertEquals(30, date.getUTCMinutes());
+assertEquals(42, date.getUTCSeconds());
+
// AM/PM were not specified.
-assertEquals(undefined, dtf.v8Parse('2/4/74 12:30:12'));
+assertEquals(undefined, dtf.v8Parse('2/4/74 12:30:42'));
// Time was not specified.
assertEquals(undefined, dtf.v8Parse('2/4/74'));
// Month is numeric, so it fails on "Feb".
assertEquals(undefined, dtf.v8Parse('Feb 4th 1974'));
-
-// Wrong date delimiter.
-assertEquals(undefined, dtf.v8Parse('2-4-74 12:30:12 am'));
« no previous file with comments | « test/intl/date-format/parse-MMMdy.js ('k') | test/intl/intl.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698