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

Unified Diff: test/intl/number-format/parse-decimal.js

Issue 18687003: Import intl test suite from v8-i18n project (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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
Index: test/intl/number-format/parse-decimal.js
diff --git a/src/extensions/i18n/footer.js b/test/intl/number-format/parse-decimal.js
similarity index 77%
copy from src/extensions/i18n/footer.js
copy to test/intl/number-format/parse-decimal.js
index ac33f1e24224957ff05d2cddef072987dd96942d..2a7fd37366ef75d635926d8814999900d2987eb4 100644
--- a/src/extensions/i18n/footer.js
+++ b/test/intl/number-format/parse-decimal.js
@@ -26,15 +26,15 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// limitations under the License.
-// ECMAScript 402 API implementation is broken into separate files for
-// each service. The build system combines them together into one
-// Intl namespace.
+var nf = new Intl.NumberFormat(['en'], {style: 'decimal'});
-// Fix RegExp global state so we don't fail WebKit layout test:
-// fast/js/regexp-caching.html
-// It seems that 'g' or test() operations leave state changed.
-var CLEANUP_RE = new RegExp('');
-CLEANUP_RE.test('');
+assertEquals(123.43, nf.v8Parse('123.43'));
+assertEquals(123, nf.v8Parse('123'));
+assertEquals(NaN, nf.v8Parse(NaN));
+assertEquals(12323, 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'));
-return Intl;
-}());
+// Scientific notation gets ignored.
+assertEquals(123.456, nf.v8Parse('123.456e-3'));

Powered by Google App Engine
This is Rietveld 408576698