Commit 4eddc6c5 authored by Frank Tang's avatar Frank Tang Committed by Commit Bot

Correct expectation of Infinity -Infinity and NaN

Bug: v8:9876
Change-Id: I2ca4512790e0a84b6f4ebd67bce76b7eb24eb33c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1867793Reviewed-by: 's avatarShu-yu Guo <syg@chromium.org>
Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Commit-Queue: Frank Tang <ftang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64439}
parent 777fa98c
...@@ -36,6 +36,11 @@ ...@@ -36,6 +36,11 @@
# https://code.google.com/p/v8/issues/detail?id=9312 # https://code.google.com/p/v8/issues/detail?id=9312
'regress-9312': [FAIL], 'regress-9312': [FAIL],
# https://bugs.chromium.org/p/v8/issues/detail?id=9876
'number-format/unified/notation-engineering-formatToParts': [FAIL],
'number-format/unified/notation-scientific-formatToParts': [FAIL],
}], # ALWAYS }], # ALWAYS
['variant == no_wasm_traps', { ['variant == no_wasm_traps', {
......
...@@ -138,36 +138,21 @@ assertEquals("0", parts[3].value); ...@@ -138,36 +138,21 @@ assertEquals("0", parts[3].value);
assertEquals(4, parts.length); assertEquals(4, parts.length);
parts = nf.formatToParts(Infinity); parts = nf.formatToParts(Infinity);
// [{type: "infinity", value: "∞"}, {type: "exponentSeparator", value: "E"}, // [{type: "infinity", value: "∞"}]
// {type: "exponentInteger", value: "0"}]
assertEquals("infinity", parts[0].type); assertEquals("infinity", parts[0].type);
assertEquals("∞", parts[0].value); assertEquals("∞", parts[0].value);
assertEquals("exponentSeparator", parts[1].type); assertEquals(1, parts.length);
assertEquals("E", parts[1].value);
assertEquals("exponentInteger", parts[2].type);
assertEquals("0", parts[2].value);
assertEquals(3, parts.length);
parts = nf.formatToParts(-Infinity); parts = nf.formatToParts(-Infinity);
// [{type: "minusSign", value: "-"}, {type: "infinity", value: "∞"}, // [{type: "minusSign", value: "-"}, {type: "infinity", value: "∞"}]
// {type: "exponentSeparator", value: "E"}, {type: "exponentInteger", value: "0"}]
assertEquals("minusSign", parts[0].type); assertEquals("minusSign", parts[0].type);
assertEquals("-", parts[0].value); assertEquals("-", parts[0].value);
assertEquals("infinity", parts[1].type); assertEquals("infinity", parts[1].type);
assertEquals("∞", parts[1].value); assertEquals("∞", parts[1].value);
assertEquals("exponentSeparator", parts[2].type); assertEquals(2, parts.length);
assertEquals("E", parts[2].value);
assertEquals("exponentInteger", parts[3].type);
assertEquals("0", parts[3].value);
assertEquals(4, parts.length);
parts = nf.formatToParts(NaN); parts = nf.formatToParts(NaN);
// [{type: "nan", value: "NaN"}, {type: "exponentSeparator", value: "E"}, // [{type: "nan", value: "NaN"}]
// {type: "exponentInteger", value: "0"}]
assertEquals("nan", parts[0].type); assertEquals("nan", parts[0].type);
assertEquals("NaN", parts[0].value); assertEquals("NaN", parts[0].value);
assertEquals("exponentSeparator", parts[1].type); assertEquals(1, parts.length);
assertEquals("E", parts[1].value);
assertEquals("exponentInteger", parts[2].type);
assertEquals("0", parts[2].value);
assertEquals(3, parts.length);
...@@ -140,36 +140,21 @@ assertEquals("0", parts[3].value); ...@@ -140,36 +140,21 @@ assertEquals("0", parts[3].value);
assertEquals(4, parts.length); assertEquals(4, parts.length);
parts = nf.formatToParts(Infinity); parts = nf.formatToParts(Infinity);
// [{type: "infinity", value: "∞"}, {type: "exponentSeparator", value: "E"}, // [{type: "infinity", value: "∞"}]
// {type: "exponentInteger", value: "0"}]
assertEquals("infinity", parts[0].type); assertEquals("infinity", parts[0].type);
assertEquals("∞", parts[0].value); assertEquals("∞", parts[0].value);
assertEquals("exponentSeparator", parts[1].type); assertEquals(1, parts.length);
assertEquals("E", parts[1].value);
assertEquals("exponentInteger", parts[2].type);
assertEquals("0", parts[2].value);
assertEquals(3, parts.length);
parts = nf.formatToParts(-Infinity); parts = nf.formatToParts(-Infinity);
// [{type: "minusSign", value: "-"}, {type: "infinity", value: "∞"}, // [{type: "minusSign", value: "-"}, {type: "infinity", value: "∞"}]
// {type: "exponentSeparator", value: "E"}, {type: "exponentInteger", value: "0"}]
assertEquals("minusSign", parts[0].type); assertEquals("minusSign", parts[0].type);
assertEquals("-", parts[0].value); assertEquals("-", parts[0].value);
assertEquals("infinity", parts[1].type); assertEquals("infinity", parts[1].type);
assertEquals("∞", parts[1].value); assertEquals("∞", parts[1].value);
assertEquals("exponentSeparator", parts[2].type); assertEquals(2, parts.length);
assertEquals("E", parts[2].value);
assertEquals("exponentInteger", parts[3].type);
assertEquals("0", parts[3].value);
assertEquals(4, parts.length);
parts = nf.formatToParts(NaN); parts = nf.formatToParts(NaN);
// [{type: "nan", value: "NaN"}, {type: "exponentSeparator", value: "E"}, // [{type: "nan", value: "NaN"}]
// {type: "exponentInteger", value: "0"}]
assertEquals("nan", parts[0].type); assertEquals("nan", parts[0].type);
assertEquals("NaN", parts[0].value); assertEquals("NaN", parts[0].value);
assertEquals("exponentSeparator", parts[1].type); assertEquals(1, parts.length);
assertEquals("E", parts[1].value);
assertEquals("exponentInteger", parts[2].type);
assertEquals("0", parts[2].value);
assertEquals(3, parts.length);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment