Math.sumPrecise testing plan
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- testing-qa
Research direction
Use the Math.sumPrecise checklist in this issue as the scope. First locate the existing test262 tests for Math.sumPrecise and follow their harness and naming conventions, then cover the unchecked boilerplate, success, failure, and iterator-observation cases. Done means the listed cases are represented and the relevant test262 tests pass.
Written by the indexing model from the issue text.
Description
Boilerplate
- Property descriptor
- Function length
- Function name
- Is not a constructor
- prototype is Function.prototype
- is extensible
Success cases
- Sum of finite numbers (same sign, mixed signs)
- Sum of one number is that number (negative, -0, 0, positive, NaN, ∞, -∞)
- Sum of empty is -0
- Sum of finite numbers with infinite result (∞, -∞)
- Sum of multiple numbers including any NaN is NaN
- Sum including any ∞ and no NaN or -∞ is ∞
- Sum including any -∞ and no NaN or ∞ is -∞
- Sum of ∞ and -∞ is NaN
- Sum of multiple -0 is -0
- Sum of multiple 0 is 0
- Sum of -0 and 0 is 0
- Sum of a non-array iterable works like sum of an array
- Sum of an empty non-array iterable is -0
Failure cases
- rejects non-Number values in iterable (Boolean, String, Symbol, BigInt, Object, null, undefined)
Other edge cases
- Not passing an argument throws TypeError
- summing each type of primitive throws TypeError
- summing a non-iterable object throws TypeError
- iterable yields more than 2⁵³ items (probably not testable)
- A case where sumPrecise disagrees with naive sum via reduce
- Order of observable operations
- iterator is closed (
returnis called) after yielding a non-Number - an Object value in the iterable does not have its
valueOf,toString, or[Symbol.toPrimitive]methods called - iterator is still exhausted after the sum has reached the NaN or ±∞ states
- array is iterated via its
[Symbol.iterator]method, not by gettinglength
- Dominant language
- JavaScript
- Stars
- 2.9k
- Forks
- 571
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 13
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tc39/test262
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
tc39/test262#5190 · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
tc39/test262#5185 · 7 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
tc39/test262#5159 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
tc39/test262#5133 · 1 comment ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 Under an hour Newbie friendliness 82/100
Leonxlnx/taste-skill#216 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
all-contributors/cli#690 ·
Maintainers usually reply within 1 day