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

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

Issue 148883002: Synchronize with r15594. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 11 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/number-format/parse-currency.js ('k') | test/intl/number-format/parse-invalid-input.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ea3f8ddf30e161eecef48a98f806515ddc6178e6 100644
--- a/src/extensions/i18n/footer.js
+++ b/test/intl/number-format/parse-decimal.js
@@ -24,17 +24,16 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// 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'));
« no previous file with comments | « test/intl/number-format/parse-currency.js ('k') | test/intl/number-format/parse-invalid-input.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698