Exponentiation Operator draft tests#96
Conversation
|
👍 |
There was a problem hiding this comment.
We don't use runTestCase anymore.
|
LGTM! |
There was a problem hiding this comment.
How would >1 author be identified in the author: ... space below?
|
I think you should remove the ES7 file path. |
|
At some point this should be updated based on the new file paths (tests would go under language/expressions/exponentiation). |
|
@bterlson will do, thanks for the ping :) |
f217123 to
b544af5
Compare
|
@bterlson updated. |
|
Should the result be exact, if both operands are integers and that result can be exactly represented ? |
|
Math.pow(3, 1) === 2.999999999999999; |
|
@Yaffle I'm going to bring this up at the next TC39 meeting |
source : http://www.netlib.org/fdlibm/e_pow.c Firefox and Chrome use "exponentiation by squaring" when second arg is a "small" integer, so integer**integer == should be exact |
b544af5 to
8711bcd
Compare
|
@bterlson updated with latest tests |
There was a problem hiding this comment.
this o.p.q test seems more appropriated in a syntax test file, where it gets the value from the lefthandexpression.
|
Can we add tests for edge cases in the Applying the ** operator section of the proposal? |
There was a problem hiding this comment.
Since we're testing operator precedence here, shouldn't these be in test/language/expressions/exponentiation/operator-precedence.js instead?
|
@goyakin "Applying the ** Operator" is just Math.pow definition, which is tested here: https://github.com/tc39/test262/tree/master/test/built-ins/Math/pow |
|
I think you need to actually test that implementations follow the same rules. The spec states they should, but the whole point of test262 is to make sure people are following the spec. This is similar to how you can't just test a given abstract operation once and assume everywhere that is specced to call it, calls it in implementations. You have to test each call site. |
Are you saying that the same tests should just be duplicated? The spec normatively defines that both |
|
Yeah, I think they definitely need to be duplicated. If we had a test-gen framework we would be in better shape. But not duplicating them would be like only testing destructuring assignment, not destructuring binding. The spec says they use the same rules, but we clearly need tests for both. |
| assert.sameValue(capture[0], "left"); | ||
| assert.sameValue(capture[1], "right"); | ||
| assert.sameValue(capture[2], "leftValue"); | ||
| assert.sameValue(capture[3], "rightValue"); |
|
@rwaldron, things LGTM except a few minor comments I left inline. |
|
@goyakin I'm pushing a bunch of updates
|
90c1c96 to
36764f0
Compare
|
I guess I need to update "id" to "esid"...? |
|
#516 will confirm this, the answer is probably yes. |
4c97f1b to
2a962f7
Compare
|
@leobalter @goyakin updated and rebased |
| description: > | ||
| Math.pow.name is "pow". | ||
| info: > | ||
| Math.pow ( x, y ) |
There was a problem hiding this comment.
You should keep the info tag here.
|
LGTM |
|
|
||
| var capture = []; | ||
|
|
||
| (capture.push("left"), leftValue) ** +(capture.push("right"), rightValue); |
There was a problem hiding this comment.
oops, missing quotes on leftValue and rightValue
There was a problem hiding this comment.
No, I accidentally deleted the definitions of those objects. Check the test just before this one
|
as I mentioned, it LGTM, there's just a minor thing missing (see comment above), preventing the tests to pass. |
|
@leobalter all set, I fixed that missing object definition |
|
|
|
@goyakin your review points have been addressed. This is all set to go whenever you're ready |
|
@rwaldron Just FYI, I converted |
This is not expected to land any time soon. It's really just for show.