Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Tests #1

Closed
20 tasks done
domenic opened this issue Jul 23, 2014 · 2 comments
Closed
20 tasks done

Tests #1

domenic opened this issue Jul 23, 2014 · 2 comments
Labels

Comments

@domenic
Copy link
Member

domenic commented Jul 23, 2014

Must be in test262 format. Ideally use the Node test262 runner @bterlson is developing (which I will probably submit patches to in the process).

  • Smoke tests
  • Array-like
  • Holes
  • ToObject
  • zero length (array and array-like)
  • negative length
  • throwing getters should cause error to be rethrown at the right algorithm step
  • ToLength works: missing .length property; negative; above max-length; Infinities; NaN; valueOf
  • fromIndex: above .length
  • fromIndex: between -.length and 0
  • fromIndex: -.length
  • fromIndex: below -.length
  • fromIndex: rounding behavior
  • fromIndex: infinities; NaN; valueOf
  • SameValueZero (kind of duplicated by smoke tests)
  • non-primitives get found correctly
  • Mutate global objects (e.g. global.Object) to ensure they are not called. Will probably require fixing especially to make the reference implementation pass.
  • Check the .length property
  • Check the property descriptor (non-enumerable, configurable, writable; test both the propdesc directly and the behaviors. test262 has helpers for this already).
  • Check the name
@domenic domenic added the work label Jul 23, 2014
@domenic domenic mentioned this issue Jul 23, 2014
6 tasks
@domenic
Copy link
Member Author

domenic commented Jul 30, 2014

After some stabs at this, my discoveries:

  • TDDing from scratch is hard. I may instead just implement a polyfill and then do massive test coverage.
  • Don't forget to write tests that mutate global state. E.g. by modifying global.Object we can ensure that the ToObject call is not implemented in terms of global.Object.

domenic added a commit that referenced this issue Jul 30, 2014
Uses especially for the reference implementation.

Closes #2, although as per #1 the TDD plan is not workable anymore.
@domenic
Copy link
Member Author

domenic commented Aug 11, 2014

Test coverage finished, as far as I can see!

@domenic domenic closed this as completed Aug 11, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant