From 3651a6715681a07b48f4461eadd243ddcfbe99b4 Mon Sep 17 00:00:00 2001 From: "jochen@chromium.org" Date: Wed, 23 Jul 2014 09:00:43 +0000 Subject: [PATCH] Rebaseline/update the intl tests with ICU 52 Update the following 4 intl tests after ICU 52 roll. date-format/parse-MMMdy.js date-format/parse-mdyhms.js number-format/parse-decimal.js number-format/parse-percent.js BUG=v8:3454 TEST=intl/* tests pass. LOG=Y R=jochen@chromium.org Review URL: https://codereview.chromium.org/410733003 Patch from Jungshik Shin . git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22544 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- test/intl/date-format/parse-MMMdy.js | 7 +++++-- test/intl/date-format/parse-mdyhms.js | 2 +- test/intl/intl.status | 6 ------ test/intl/number-format/parse-decimal.js | 4 +++- test/intl/number-format/parse-percent.js | 4 +++- 5 files changed, 12 insertions(+), 11 deletions(-) diff --git a/test/intl/date-format/parse-MMMdy.js b/test/intl/date-format/parse-MMMdy.js index b23a3cd..3e1d9dc 100644 --- a/test/intl/date-format/parse-MMMdy.js +++ b/test/intl/date-format/parse-MMMdy.js @@ -41,8 +41,11 @@ assertEquals(1974, date.getUTCFullYear()); assertEquals(1, date.getUTCMonth()); assertEquals(4, date.getUTCDate()); -// Missing , in the pattern. -assertEquals(undefined, dtf.v8Parse('Feb 4 1974')); +// Missing , in the input is not a problem any more. +date = dtf.v8Parse('Feb 4 1974'); +assertEquals(1974, date.getUTCFullYear()); +assertEquals(1, date.getUTCMonth()); +assertEquals(4, date.getUTCDate()); // Extra "th" after 4 in the pattern. assertEquals(undefined, dtf.v8Parse('Feb 4th, 1974')); diff --git a/test/intl/date-format/parse-mdyhms.js b/test/intl/date-format/parse-mdyhms.js index 73efb62..bd333c3 100644 --- a/test/intl/date-format/parse-mdyhms.js +++ b/test/intl/date-format/parse-mdyhms.js @@ -34,7 +34,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()); diff --git a/test/intl/intl.status b/test/intl/intl.status index 007943a..4ecbf32 100644 --- a/test/intl/intl.status +++ b/test/intl/intl.status @@ -38,11 +38,5 @@ # BUG(2899): default locale for search fails on mac and on android. 'collator/default-locale': [['system == macos or arch == android_arm or arch == android_ia32', FAIL]], - - # BUG(v8:3454). - 'date-format/parse-MMMdy': [FAIL], - 'date-format/parse-mdyhms': [FAIL], - 'number-format/parse-decimal': [FAIL], - 'number-format/parse-percent': [FAIL], }], # ALWAYS ] diff --git a/test/intl/number-format/parse-decimal.js b/test/intl/number-format/parse-decimal.js index ea3f8dd..01415b6 100644 --- a/test/intl/number-format/parse-decimal.js +++ b/test/intl/number-format/parse-decimal.js @@ -30,7 +30,9 @@ var nf = new Intl.NumberFormat(['en'], {style: 'decimal'}); assertEquals(123.43, nf.v8Parse('123.43')); assertEquals(123, nf.v8Parse('123')); assertEquals(NaN, nf.v8Parse(NaN)); -assertEquals(12323, nf.v8Parse('123,23')); + +// a misplaced comma without a decimal point is not tolerated any more. +assertEquals(undefined, nf.v8Parse('123,23')); assertEquals(12323.456, nf.v8Parse('123,23.456')); assertEquals(12323.456, nf.v8Parse('0000000123,23.456')); assertEquals(-12323.456, nf.v8Parse('-123,23.456')); diff --git a/test/intl/number-format/parse-percent.js b/test/intl/number-format/parse-percent.js index 4964da4..104c003 100644 --- a/test/intl/number-format/parse-percent.js +++ b/test/intl/number-format/parse-percent.js @@ -30,7 +30,9 @@ var nf = new Intl.NumberFormat(['en'], {style: 'percent'}); assertEquals(1.2343, nf.v8Parse('123.43%')); assertEquals(1.23, nf.v8Parse('123%')); assertEquals(NaN, nf.v8Parse(NaN)); -assertEquals(123.23, nf.v8Parse('123,23%')); + +// a misplaced comma without a decimal point is not tolerated any more. +assertEquals(undefined, nf.v8Parse('123,23%')); assertEquals(123.23456, nf.v8Parse('123,23.456%')); assertEquals(123.23456, nf.v8Parse('0000000123,23.456%')); assertEquals(-123.23456, nf.v8Parse('-123,23.456%')); -- 2.7.4