Commit Graph

1558 Commits

Author SHA1 Message Date
jugglinmike ab4ff914fb Add tests for assignment target validation of new ES2015 forms (#693)
This re-factors some existing Sputnik tests to be more targeted and to use a
pattern that can be generalized to other forms. We could test these all day,
but I've limited myself to forms introduced in ES2015, specifically
YieldExpression and new.target. Note that SpiderMonkey incorrectly throws a
SyntaxError for these.
I thoughtlessly wrote ReferenceError tests for yield = 1 until I realized
that such productions are not actually recognized by the grammar, so the early
errors do not apply. Instead, I've added a negative syntax test for that case.

* Refactor test for valid cover

* Add tests for ValidSimpleAssignmentTarget

Ensure that constructs introduced in ES2015 are disallowed as assignment
targets, with or without a "cover" grammar.

* Add test for grammar precedence of YieldExpression
2016-07-05 15:20:56 -07:00
jugglinmike f554f68ae9 Improve coverage for section 21: String (#712)
This changeset increases coverage for section 21, specifically "21.1 String
Objects".

* Add tests for "this" validation of String methods

* Add tests for ToNumber as used by String methods

* Add test for `length` prop of exotic String objs

* fixup! Add test for `length` prop of exotic String objs
2016-07-05 14:04:31 -07:00
Leonardo Balter 021d44822c Add tests for custom ctor returns on TypedArrays from and of 2016-07-05 16:29:23 -04:00
Leonardo Balter 6fcbfaf0f0 Assert TypedArray iterators inherit from ArrayPrototypeIterator 2016-07-05 16:29:22 -04:00
Leonardo Balter c204c30a54 Remove invalid test from ArrayBuffer subclassing
Fixes gh-696

As pointed in gh-696, the ArrayBuffer ctor won't throw a RangeError when
invoked without arguments.

Instead of fixing the invalid assertion, this commit removes it as the
coverage for subclassing is already satisfied by the use of slice.
2016-07-05 16:29:21 -04:00
Leonardo Balter a78cf3de4a Fix tests for DataView#setFloat when no value arg is provided
Fixes gh-686
2016-07-05 16:29:21 -04:00
Leonardo Balter 09be4da196 Fix test for TypedArray(length)
Fixes gh-694
2016-07-05 16:29:21 -04:00
Leonardo Balter 6497c1f5cc Merge tests for TypedArrays#length when this is not object 2016-07-05 16:29:20 -04:00
Leonardo Balter d190e700f3 Add bit-precision tests for TypedArray#copyWithin 2016-07-05 16:20:16 -04:00
jugglinmike fce8b5852d Extend coverage for Section 25 - Generators (#700)
* Improve tests for GeneratorPrototype methods

- Assert return values more consistently
- Expand tests for constraints on `this` value

* Add more tests for dynamic GeneratorFunctions

* Add more tests for GenerationFunction.prototype

* Add more tests for the GeneratorFunction object

* Extend test: GeneratorFunction.prototype.prototype

* Improve precision of tests for generator methods

Extend existing assertions to explicitly verify that execution halts at
the intended location. Correct tests which were previously asserting
this behavior in contexts that did not match their name/description.

* Remove unused variables

* fixup! Improve tests for GeneratorPrototype methods

* fixup! Improve tests for GeneratorPrototype methods
2016-07-01 11:24:27 -07:00
jugglinmike e290a337b8 Improve coverage for section 12, "Expression" (#695)
* Add missing test for early error

* Add missing test for WithBaseObject

* Improve coverage for `new.target`

* Add test for deletion of SuperReference

* Add tests for `in` keyword restrictions

* fixup! Improve coverage for `new.target`
2016-07-01 11:23:43 -07:00
Leo Balter e49d2661a8 Improve assertions comparing values to NaN (#690)
The global isNaN is not precise at all, and Number.isNaN is an ES6 feature that makes it preferrable to use assert's sameValue for NaN values, as it handles it internally using the comparison.
2016-07-01 11:22:55 -07:00
jugglinmike a3fffa754b Improve coverage for "super" keyword (#687)
* Improve test coverage for `super` keyword

Add tests for SuperCall and SuperProperty, organized together in the
`test/language/expressions/super/` directory. For SuperProperty, include
tests for usage from within Object initializers and class bodies because
a different set of semantics are observable from each context.
2016-06-29 16:45:19 -07:00
jugglinmike 23efc2c96a Extend test for HTML comments (#684)
Extend test for HTML comments

The V8 engine incorrectly requires a leading newline character for
MultiLineComments which contain the optional trailing HTMLCloseComment
[1]. Extend the current tests to fail when such an invalid restriction
is in place.
[1] https://bugs.chromium.org/p/v8/issues/detail?id=5142
2016-06-28 15:54:40 -07:00
Tom Care a57c1f25f1 Merge pull request #678 from samccone/sjs/switch-to-option-arg
Switch to non-positional argument.
2016-06-28 11:16:58 -07:00
jugglinmike be19aaa18e Add tests ensuring iterator is not closed (#702)
A subtle aspect of the for-of iteration protocol concerns abrupt
completions that do *not* trigger iterator closing. Although this detail
is implicit in the current structure of the specification text, some
hosts may violate the protocol by closing the iterator because later
steps *do* specify that behavior.

The V8 engine is one such host--as of this writing, it incorrectly
closes the iterator when accessing the `value` property of the iterator
result produces an abrupt completion.

Add tests verifying that the iterator protocol is not violated in this
way for abrupt completions during the semantics of for-of evaluation.
2016-06-28 10:55:18 -04:00
Leonardo Balter f3bfaa692d Expand tests for Math.log1p 2016-06-27 16:04:17 -04:00
Leonardo Balter 080afac906 Update tests for Math.{sign,sin,trunc} 2016-06-27 16:04:17 -04:00
Leonardo Balter e3e7a510ff Expand tests for Math.imul 2016-06-27 16:04:17 -04:00
Leonardo Balter 80c1c46b53 Update tests for Math.hypot 2016-06-27 16:04:16 -04:00
Leonardo Balter f88c93520d Expand tests for Math.fround 2016-06-27 16:04:16 -04:00
Leonardo Balter d6eb13b4b5 Expand tests for Math.clz32 2016-06-27 16:04:15 -04:00
Leonardo Balter 440211e96a Update tests for Math.acosh 2016-06-27 16:04:15 -04:00
Leonardo Balter 561ac9e473 Extend coverage for Math.abs 2016-06-27 16:04:15 -04:00
Leonardo Balter 0f29f57fdc Update Math functions to handle distinct -0 and +0 2016-06-27 16:04:15 -04:00
Leonardo Balter 13e01e4340 Add tests for Math.{max,min} handling zeros 2016-06-27 16:04:14 -04:00
Leonardo Balter ec3a89ebb8 Add test for the Math object 2016-06-27 16:04:14 -04:00
Leonardo Balter 059b7cd4a3 Remove invalid tests
ConversionError and RegExpError tests are methods that existed on
something that preceeded a IE9 Standard. They do not exist in the
specs, at least since ES5.

It's not test262 responsibility to maintain these tests as these
features can be freely implemented by any runtime.
2016-06-27 15:57:56 -04:00
Leonardo Balter 1eaae52eb8 Add prop-desc tests for Number.prototype properties 2016-06-23 14:42:40 -04:00
Leonardo Balter 4dd7e5aa4b Extend Number tests to assert abrupt completions 2016-06-23 14:42:40 -04:00
Leonardo Balter 9223f56344 Update and add basic prop-desc tests for Number
and Number.prototype
2016-06-23 14:42:40 -04:00
Leonardo Balter 8066b9ecaf Add tests for Number.{parseFloat,parseInt} 2016-06-23 14:42:39 -04:00
Leonardo Balter 47f806ecef Update tests for Number.NaN 2016-06-23 14:42:39 -04:00
Leonardo Balter 4492b8032b Add tests for Number.isSafeInteger 2016-06-23 14:42:39 -04:00
Leonardo Balter 3685e6b7b3 Update and add tests for Number.isNaN 2016-06-23 14:42:39 -04:00
Leonardo Balter c246bc7d09 Add tests for Number.isInteger 2016-06-23 14:42:39 -04:00
Leonardo Balter 46d8c3d6b8 Add tests for Number.isFinite 2016-06-23 14:42:39 -04:00
Leonardo Balter 454b8f10b8 Update and add tests for Number.POSITIVE_INFINITY 2016-06-23 14:42:39 -04:00
Leonardo Balter 7e55e54538 Update and add tests for Number.NEGATIVE_INFINITY 2016-06-23 14:42:39 -04:00
Leonardo Balter 36909a0595 Add tests for Number.EPSILON 2016-06-23 14:42:38 -04:00
Tom Care 149cd4ae9a Merge pull request #673 from bocoup/relax-test
Relax test for forbidden extension
2016-06-22 15:41:46 -07:00
Tom Care b324c7d88f Merge pull request #680 from bocoup/597-remove-oldlen
Remove unused variables
2016-06-22 15:40:54 -07:00
Tom Care b4664d5d20 Update maintainer in README.MD
Update the maintainer to @tcare as @goyakin is no longer maintaining the repo.
2016-06-22 15:20:24 -07:00
Leonardo Balter ac628975a3
Remove unused variables
Fixes gh-597
2016-06-21 13:03:22 -04:00
Leo Balter 9370371ac5 Merge pull request #660 from bocoup/dflt-params
Add tests for default parameters
2016-06-21 12:35:29 -04:00
Mike Pennisi 418386e33e
Remove redundant tests
These tests have been re-factored to expand coverage of the "default
parameter" language feature and to more closely adhere to this project's
preferred file organization.
2016-06-21 12:22:50 -04:00
Mike Pennisi 655a880852
Add tests for arguments obj with dflt parameters 2016-06-21 12:22:49 -04:00
Mike Pennisi 7e3019e382
Add tests for function length with dflt parameters 2016-06-21 12:22:49 -04:00
Mike Pennisi 7dcccfcca6
Add tests for use of `yield` in default parameters 2016-06-21 12:22:48 -04:00
Mike Pennisi e5f1740411
Generate tests 2016-06-21 12:22:48 -04:00