Commit Graph

89 Commits

Author SHA1 Message Date
André Bargull 9cc4016866 Replace runTestCase with assert helpers [test/built-ins/Object/{freeze, preventExtensions, seal}] 2015-08-11 17:51:16 +02:00
André Bargull 4facaaab5f Replace runTestCase with assert helpers [test/built-ins/Object/create] 2015-08-11 17:50:53 +02:00
André Bargull f3e919209c Replace runTestCase with assert.throws [test/built-ins/Object] 2015-08-11 17:43:48 +02:00
Mike Pennisi d6bbbc9aed Add tests for well-known Symbol: @@toStringTag 2015-08-07 20:02:44 -04:00
Brian Terlson 2284a46ebf Merge pull request #385 from anba/license
Change license headers to standard format
2015-07-17 11:03:07 -07:00
André Bargull 023c7aa69e - Remove inline license
- Remove duplicate word
- Add missing license
2015-07-17 19:55:00 +02:00
André Bargull a85f5039e0 Remove links to hg.ecmascript.org 2015-07-17 17:43:09 +02:00
Mike Pennisi 10e0d977ec Prefer explicit error checking where possible
The `negative` frontmatter tag expresses an expectation for the behavior
of the test file as a whole. The `assert.throws` helper function offers
more fine-grained control over expectations because it may be applied to
specific statements and expressions. This makes it preferable in cases
where it may be used (i.e. when the test body does not describe a syntax
error or early error).

Re-implement assertions for errors to use the `assert.throws` helper
function wherever possible.
2015-07-10 14:12:57 -04:00
Pieter van Ginkel a5e4c2ade5 Fixed invalid configuration block delimiters.
Two tests started the configuration block with a /*-- instead of a /*---.
2015-06-28 07:35:54 +02:00
Brian Terlson f06791ea4b Merge pull request #328 from bocoup/object-set-prototype-of
Add tests for Object.setPrototypeOf
2015-06-25 14:46:43 -07:00
Brian Terlson e4a25da86a Merge pull request #305 from jugglinmike/browser-only-strict
Update browser runner to honor `onlyStrict` flag
2015-06-25 14:44:34 -07:00
Mike Pennisi 3fb882acd0 Add tests for Object.setPrototypeOf 2015-06-19 12:13:28 -04:00
Mike Pennisi 39cd09f7a8 Extend coverage for Object.assign 2015-06-19 10:38:22 -04:00
Mike Pennisi 29ecced632 Update handling of directive prologues
Some tests specifically concern the application of the `use strict`
directive as it appears in JavaScript source code. These tests should
*not* be run with the `onlyStrict` flag because relying on the test
runner to enable strict mode makes the semantics of the source code
irrelevant. Update these tests to use the `noStrict` flag.

Other tests concern language semantics that are only valid in strict
mode, but the mechanism for enabling strictness is inconseqential.
Update these tests to use the `onlyStrict` flag and remove any redundant
`use strict` directive prologues contained within.

Still other tests are valid both within and outside of strict mode.
In keeping with the majority of other tests, do not specify any
restrictions on the environments in which these tests may be run.
2015-06-18 17:38:34 -04:00
Yanli Xu 07b21a5e44 add tests for Object.assign 2015-06-18 15:23:15 +08:00
Mike Pennisi fe11a1ea1a Remove $PRINT helper function
The `$PRINT` helper function has no effect on test behavior. The
following tests use it to report assertion outcomes (and as a result
will fail silently):

- test/language/function-code/S10.2.1_A4_T2.js
- test/language/function-code/S10.2.1_A5.1_T1.js
- test/language/function-code/S10.2.1_A5.1_T2.js
- test/language/function-code/S10.2.1_A5.2_T1.js

Remove the function definition and all references within tests. Update
tests that use it as an error reporting mechanism to instead use an
appropriate `assert` helper function.
2015-06-16 13:43:23 -04:00
Mike Pennisi 57f3466cf7 Fix tautological pattern in tests
In neglecting to assert the type of error thrown (or that any error was
thrown at all), these tests cannot fail. Refactor the tests to use the
`assert.throws` helper method, which takes these details into
consideration.
2015-06-16 12:55:56 -04:00
Mike Pennisi 92890e6723 Remove `$FAIL` function
This function is equivalent to `$ERROR` (which is automatically included
in test environments). Remove the harness file that defines the
function, remove references to the file from test `includes` lists, and
update scripts to instead invoke the `$ERROR` function.
2015-06-09 19:44:25 -04:00
André Bargull 56036e4064 Enable strict mode for more built-in tests
- Remove no longer needed noStrict flags.
- Change tests to use propertyHelper.js for strict mode compatibility.
- Add tests for return value of `delete` operator, e.g. `delete Array.prototype === false`.
- Add non-writable tests for global NaN property.
- Split some tests to run in strict mode.
- Change tests with global `var length` declaration to use a different variable name for browser environments.
- Merge duplicated tests symbol-data-property-configurable-non-strict and symbol-data-property-configurable-strict.
- Merge duplicated tests symbol-data-property-writable-non-strict and symbol-data-property-writable-strict.
- (And a small change in propertyHelper to reduce code duplication in function call.)
2015-05-18 18:01:00 +02:00
Brian Terlson 5188ab028a Merge pull request #261 from smikes/object-strict
strict mode: use new property helpers
2015-05-07 13:15:07 -07:00
Brian Terlson 3218458c25 Merge pull request #262 from smikes/object-strict-pr2
Candidate fix of empty catch{}
2015-05-07 13:00:47 -07:00
smikes 55c1ef113d add line note fixes from #255 2015-05-07 11:00:25 -06:00
smikes d869dc6ce3 candidate fix for line note on 259 2015-05-07 10:54:50 -06:00
smikes 71c1a9cb3a changes from line notes 2015-05-07 10:49:00 -06:00
smikes 6ccabc093b strict mode: use new property helpers
Object.freeze fixes
global object tests: noStrict
preventExtensions tests
Object.seal tests

one more freeze test
2015-05-06 19:03:25 -06:00
smikes 26ede592a8 fix tests in strict mode - Object/defineProperty 2015-05-06 13:57:54 -06:00
smikes d513714fda update, fix merge conflict 2015-05-02 20:20:47 -06:00
smikes 9824be6825 rewrite tests to work in strict mode, use helpers 2015-05-02 05:12:53 -06:00
André Bargull 2bc08d0b0b Fix some strict mode errors in built-ins/Object
- Add missing "var" declarations and noStrict flags
- Remove invalid noStrict flags
- ietestcenter tests need fixed, require updates to use propertyHelper.js

Part of issue #35.
2015-04-29 17:41:42 +02:00
André Bargull e31ae1ad9f Invalid language tests
- in-statement-position-label-statement.js is an Annex-B test (B.3.2 Labelled Function Declarations), moved to annexB directory
- identifier-let-allowed-as-lefthandside-expression-strict.js needs to check for a SyntaxError (ES6, 12.1.1)
- Remove sort() calls in test/built-ins/Object/getOwnPropertyNames/*.js
- Remove sort() calls in test/language/block-scope/syntax/for-in/acquire-properties-from-*.js
- verifyConfigurable() needs to called last in test/built-ins/Object/is/length.js
- All productions within ClassBody are implicitly strict, update test/language/class/method-definition/yield-as-*.js accordingly
- Remove unnecessary noStrict flag in test/language/class/method-definition/yield-as-generator-method-binding-identifier.js
- Check own symbols are returned in property creation order from Object.getOwnPropertySymbols():
  - test/language/computed-property-names/basics/symbol.js
  - test/language/computed-property-names/class/method/symbol.js
  - test/language/computed-property-names/class/static/method-symbol.js
  - test/language/computed-property-names/object/method/symbol.js
- Fix copy-paste error in test/language/expressions/object/method-definition/yield-as-function-expression-binding-identifier.js
2015-04-27 16:56:19 +02:00
Rick Waldron b3cbeaacb7 19.1.2.10 Object.is
7.2.9 SameValue(x, y)
2015-04-21 14:25:53 -04:00
Brian Terlson 43a238bc0b Merge pull request #197 from bocoup/harmony-symbols
Import tests from Google V8 (Symbol)
2015-04-18 15:49:46 -07:00
Brian Terlson 01bdfa6dd3 Merge pull request #209 from anba/issue-185,186/annexb-extensions
Don't use Annex B extensions in main test suite
2015-04-08 16:08:04 -07:00
Rick Waldron 59e2a7ac57 Import tests from Google V8 (Symbol)
These tests are derived from the following files within the Google V8 project:

	test/mjsunit/harmony/private.js
2015-04-07 16:53:18 -04:00
Rick Waldron d797bb979e Import tests from Google V8 (Array.prototype.{fill, find, findIndex}, Array.{from, of})
These tests are derived from the following files within the Google V8 project:

    	test/mjsunit/harmony/array-fill.js
    	test/mjsunit/harmony/array-find.js
    	test/mjsunit/harmony/array-findindex.js
    	test/mjsunit/harmony/array-from.js
    	test/mjsunit/harmony/array-of.js
2015-04-07 09:53:17 -04:00
André Bargull a7192a9ea5 Don't use Annex B extensions in main test suite
Fixes #185
Fixes #186
2015-03-23 19:29:25 +01:00
André Bargull e12917af66 Update comments in Object.defineProperties tests (Fixes #138)
The expected values were already changed in a previous commit (@49abae4f5e6b38931d86dc9b9d34ae30d9ced2ca),
only the test descriptions still needed to be updated. (Fixes #138)
2014-12-11 19:00:15 +01:00
smikes 49abae4f5e rework: remove *PropertyAttributes fns
- this change hits all files that use
dataPropertyAttributesAreCorrect or
acccessorPropertyAttributesAreCorrect

Major changes:
- remove include of runTestCase.js,
dataPropertyAttributesAreCorrect.js and
acccessorPropertyAttributesAreCorrect.js
- add include of propertyHelper.js
- remove function testCase() and call to
function runTestCase()
- instead of collecting test state into booleans,
which are eventually returned from runTestCase,
test conditions and throw errors immediately
- use negative: to check error types instead of
using `instanceof` in a catch() block

Selected commit logs follow:

manual conversion of accessorPropertyAttributesAreCorrect() test
 - remove runTestCase
 - remove wrapping testCase function
 - unindent
 - remove includes of runTestCase & accessor...
 - add include of propertyHelper.js
 - unpack final two args 'true, false' to explicit inline
   tests of isEnumerable and isConfigurable
 - unpack setter test into inline logic
 - unpack getter test into inline logic

used script to replace includes: frontmatter
with propertyHelper.js ; manually added back
references to fnGlobalObject() where needed

additional helper functions

add helper functions for get and writable
duplicate runTestCase so can remove runTestCase.js from
includes of all tests in batch

use keyboard macros to simplify repetitive conversions
remove auto-save file accidentaly committed

minor changes, manually remove runTestCase from remaining files
lint etc. fixes

remove now-obsolete harness files

make strict/nonstrict variants

tests where behavior is different in strict/nonstrict
need two variants

- strict mode throws on assign to read-only element (no setter fn)
- strict mode separates named arguments from arguments[]

fix indentation

cleanup minor issues

reviewing 15.2.3.7-9 tests, found some minor issues

- indentation/spacing
- duplicate test (eg, direct test of value and dataProp...)
- remove needless try/finally
- use assert.. helpers in place of if(is..
- rename some assertions to 'e'

rename assertX to verifyX
new helper fn sameValue
test "set" as well as get
reverse order of checks
restore test of desc2
restore test of length
restore test of ownProperty
incorporate suggestions re order of ops, Object.prototype
add test of sameValue helper
restore return value in getter
restore second defineProperty call
restore check of explicit "false"
restore explicit test of TypeError
set noStrict flag on arguments changes
rename catch var to "e"	b4ad0e6
remove dataPropertyAttributesAreCorrect from tests	0d83ff2
remove accessorPropertyAttributesAreCorrect from tests	bb926f3
remove {data,accessor}Property... fns from harness

fix writable check on array.length

call $ERROR if expected exception not thrown
fix Epected => Expected typo

use assert._isSamevalue
2014-12-10 17:39:16 -08:00
Brian Terlson 2a74f0ec1b Reorganize ./test 2014-12-07 15:33:09 -08:00