Commit Graph

80 Commits

Author SHA1 Message Date
Leonardo Balter bc42c6ab5c Add harness for byte conversion values
Update testTypedArrayConversions to require byteConversionValues
2016-05-25 10:10:50 -04:00
Gorkem Yakin f6475d81bf Merge pull request #543 from bocoup/enumerable-helper
Fix verifyEnumerable helper to account for properties with Symbol values
2016-04-25 16:32:53 -07:00
jugglinmike ba3dacbe5a Correct tests for native functions' toString value (#580)
Modify the regular expression for native functions' toString value to
satisfy all test cases. Correct the test file's reference to the harness
file. Re-format the test file's assertions to aid debugging in the event
of failure.
2016-04-21 15:55:54 -04:00
jugglinmike cf68c3be91 Correct invalid tests for the Date constructor
The millisecond representation of a given Date instance is dependent on
the local system's time zone settings. In order to pass consistently
across contexts, tests for this value must take the system configuration
into account.

Introduce a test harness utility function to encapsulate these concerns.
Re-use this function across all test files that assert the exact
millisecond representation of Date instances.
2016-04-19 17:00:59 -04:00
Leonardo Balter e7f6cd7f86 assert.throws fails if second argument is not a function 2016-04-15 10:14:54 -04:00
Michael Ficarra 6b7cbb5035 add Function.prototype.toString tests, conforming to proposed revision
See the proposal at
https://tc39.github.io/Function-prototype-toString-revision/
2016-04-11 14:39:12 -04:00
Leonardo Balter a93ef42b56 Fix verifyEnumerable helper to account for Symbol properties 2016-03-15 10:13:52 -04:00
Leonardo Balter bf782c8421 s/id/esid
Fixes #477
2016-02-22 09:47:42 -05:00
Jordan Harband a6fad62d7c Last minute fixes 2016-02-19 11:27:31 -08:00
Jordan Harband 59dad9172b Make proxy traps helper test a bit more robust.
Per https://github.com/tc39/test262/pull/484#discussion_r53228232
2016-02-17 12:50:26 -08:00
Jordan Harband d530c87b41 Create `proxyTrapsHelper` to throw on all traps by default. 2016-02-13 15:56:47 -08: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
Mike Pennisi 3211e33199 Add tests for test harness 2015-04-22 18:38:40 -04:00
Brian Terlson 1f2f7d062f Move assert helper as well 2014-12-09 13:46:53 -08:00
Brian Terlson 2a74f0ec1b Reorganize ./test 2014-12-07 15:33:09 -08:00
Domenic Denicola fa4c337570 Add assert.throws
Closes #57.
2014-12-05 14:41:04 -05:00
Domenic Denicola 4bb8c027e4 Add initial assert helpers
Closes #110
2014-12-01 15:44:33 -05:00
Sam Mikes 4debe08707 browser runner: check negative regex
1. use negative regex (instead of ".") to check iframeError
2. make Test262Error.prototype.toString() always include
   the string Test262Error (no spaces) so it matches /Test262Error/
3. modify check for supportsWindowOnerror - require that
   first argument (message) to onerror() contains the error name
   by checking for /Error:/.

Change (3) above forces IE11 onto the !supportsWindowOnerror path.
Test262 tests are run inside an eval() on IE11, and errors are
caught and explicitly have toString() called.  Without this,
IE11 passes only the `message` property to onerror(), and regexes
that expect to match error name fail.

sth: revert to simple `onerror` checking

gs: refactor function `$DONE`

refactor logic tree
add support for async test failures

ed.js: crude support for error typing

S8.7.1_A2: cache result of delete

`delete` has a side-effect and its
return value depends on this; cache result of
delete so when reporting result, we are always
reporting the result that made us fail, not the
result of a new delete
[pedantic]

ed: explicitly pass cooked error to $DONE

gs: only let $DONE be called once
2014-08-13 12:24:12 +01:00
Sam Mikes 4205a1da64 harness: remove unused code
sta.js:
slight change to Test262Error() semantics; message property now always set (default "")
make $ERROR a var
set $ERROR to function $ERROR so it can be overridden if needed
remove 2009 copyright in favor of 2012 copyright
REVERTED: remove never-used fn testFailed
testFailed actually used by $FAIL
remove obsolete fn $INCLUDE

ed.js:
remove commented-out obsolete code

test262.py:
remove always-included harness file that provides no functions used by any extant test
add comment line to nonstrict

cth.js: define `print` for node, cscript

use cth (console test harness) to define functions
for console runner.  V8, Spidermonkey (js) and JavaScriptCore (jsc)
provide a function `print`.  Provide a default `print` for node
and cscript

set print_handle to 'print' by default (can still override)
for cscript: wrap tests in try/catch so we get syntax errors
2014-08-03 00:33:08 +01:00
Sam Mikes c33bf0e043 tools, harness: support new YAML frontmatter
parseTestRecord: add support for YAML frontmatter
parseTestRecord: initial unit test for test record parser
parseTestRecord: refactor for testing

factor old parsing; add YAML parsing

runner: support "includes" from YAML frontmatter

support frontmatter "includes" in python runner
use test.includes if present instead of scanning test code with regex

harness: factor individual functions out into files

tools: handle YAML errors

tolerate missing keys in dictionary (flags, includes)
report filename when empty frontmatter block
new option --list-includes to test262.py

harness: factor helper functions into separate files

sth: remove extra close-paren (syntax error)

test_common: TDD; failing parse of YAML

common: use parseTestRecord (YAML-aware)
2014-07-30 15:39:04 -07:00
smikes a8c49d8b47 sth: correct syntax error in new fn isAsyncTest 2014-07-22 10:41:32 -06:00
Sam Mikes d4a3479a1e test262.py: only include helper scripts when needed
test262.py: only supply async helper scripts when test is async
sth.js: factor out function isAsyncTest()
timer.js: improve workaround for async tests when Promise is defined but setTimeout is noot

timer.js emulates setTimeout using Promise by doing a busy loop that checks
if `timeout` milliseconds have elapsed.  Modified check to (timeLeft > 0) instead
of (!timeLeft) to prevent infinite loop when check does not happen to run
at precise millisecond timeout expires.

Because test262.py did not support the $INCLUDE directive, some helper
scripts were added to every test -- notably testIntl, timer, and donePrintHandle
Now that $INCLUDE is supported, these can be dropped, speeding overall test run time
2014-07-21 15:15:04 +01:00
Sam Mikes 7e07cc138d async,promises: initial tests of Promises
doneprintHandle.js: make $DONE accept any falsy argument as meaning 'pass'
PromiseHelper.js: checkSequence: new helper fn for async tests
.gitignore: port .hgignore to .gitignore syntax
test262.py: support $INCLUDE directive in python test runner

S25.4.4.1*: tests to cover Section 25.4.4.1, Promise.all( iterable )
A1.1: Promise.all is callable
A1.2: Promise.all expects 1 argument
A2.1: Promise.all([]) is a Promise
A2.2: Promise.all([]) is resolved immediately
A2.3: Promise.all([]) is resolved with a new empty array
A3.1: Promise.all expects an iterable argument
2014-07-18 05:37:08 +01:00
NikSurya 9aa6b917fa Adding Support for Async Tests 2014-07-15 13:47:59 -07:00
Brent Baker 91bb82fb7e Bug 1548: Update results handling for Annex B section (r+bterlson) 2013-06-07 07:05:37 -04:00
Norbert Lindenberg 96321f30c9 New tests and test fixes for ECMAScript Internationalization API.
Updated copyright notice for 2013.
2013-03-24 23:48:59 -07:00
Bill Ticehurst 9d19c87e3e Bug 610: Handle supplementary characters. 2012-08-09 15:02:49 -07:00
Norbert Lindenberg 75fbd71ee0 Updated tests for ECMAScript Internationalization API spec changes; made small enhancements.
- Updated DateTimeFormat tests for new handling of hour12 options property.
- Added a few invalid language tags to test of IsStructurallyValidLanguageTag.
- Added user-defined language tag to test of CanonicalizeLanguageTag.
- Added test for the Intl property of the global object.
2012-09-10 11:53:56 -07:00
Norbert Lindenberg d71ffa59d5 Added new tests for chapters 10 to 13 of the ECMAScript Internationalization API Specification. 2012-08-26 20:50:24 -07:00
Norbert Lindenberg 1af2425075 Added new tests for chapters 6 and 9 of ECMAScript Internationalization API Specification.
- Removed a few old test cases that were redundant with new, more comprehensive ones.
- Added testIntl.js as standard include for all console tests in test262.py – see related bug 574.
- Added .jshintrc file for settings for the JSHint tool.
2012-08-26 20:49:25 -07:00
Norbert Lindenberg 8cad7d03ce Added tests for requirements imposed on the built-in objects of the ECMAScript Internationalization API Specification by the introduction of chapter 15 of the ECMAScript Language Specification.
- Removed some old tests that were redundant with the new tests.
- Added testBuiltInObject.js as standard include for all console tests in test262.py – see related bug 574.
2012-08-26 20:48:49 -07:00
Norbert Lindenberg 9f4a513496 Merged changes. 2012-08-22 16:12:54 -07:00
Norbert Lindenberg 9a4b4011f8 Got test402 web site into usable shape. Unified headers of test262/402 sites.
- Added table of contents for ECMA-402.
- Added ability to load the right table of contents into results display.
- Added meaningful text to test402 web page.
- Updated test262 web pages for 5.1 edition of ECMA-262.
- Unified headers of test262/402 web pages to ECMAScript <area> <test>.
- Replaced text logos with styled text.
- Decapitalized some text; fixed a typo; expanded an abbreviation.
- Fixed a few issues found by W3 HTML validator.
2012-07-18 12:32:54 -07:00
t-adamre 385b4f7163 Add capability to run chapters individually from the website 2012-06-12 14:54:30 -07:00
David Fugate 87be1bf6ec https://bugs.ecmascript.org/show_bug.cgi?id=65 fixed. 2012-03-28 16:05:03 -07:00
David Fugate d6634f8e10 Fixed https://bugs.ecmascript.org/show_bug.cgi?id=293. ConstructDate cannot be
salvaged (e.g., need locale info to properly predict whether we're subject to
DST).
2012-03-26 13:50:38 -07:00
David Fugate 0612ad7bb3 Added a LICENSE file to the root of the enlistment.
All Microsoft-contributed *.js and *.py sources now have Ecma's copyright header.
2012-02-29 14:23:47 -08:00
David Fugate 4fb5071cd4 Migrated latest external\contributions\Microsoft\ietcLatest changes over to test\suite\*. 2012-02-27 15:46:23 -08:00
David Fugate e0d156d38c Implemented the following work items:
- https://bugs.ecmascript.org/show_bug.cgi?id=44
- https://bugs.ecmascript.org/show_bug.cgi?id=45
2012-02-22 11:53:29 -08:00
David Fugate 5df3134fac Fixed https://bugs.ecmascript.org/show_bug.cgi?id=207. 2011-11-11 11:40:05 -08:00
Mark Miller 13b63c5486 test262 console runner working! 2011-09-30 08:24:38 -04:00
Mark Miller 64db10aa2d Just reformatting to 80 columns 2011-09-30 03:59:50 -04:00
David Fugate ffa85c2584 Moved all test helper functions into sta.js; removed sputnikLib.js.
Laid down the groundwork for a console-based test runner.
2011-09-26 16:12:46 -07:00
David Fugate 352d86b8ed Support not-NotEarlyError as well. 2011-09-25 17:05:32 -07:00
David Fugate d5bf95c628 Made exception type checking looser: window.onerror isn't spec'ed to give us the
exact error type, but we should get the '.message' property.
2011-09-25 10:47:34 -07:00
David Fugate 2b0122ef82 All tests are globally scoped tests - Part I. 2011-09-24 16:35:45 -07:00
David Fugate 5be3b44a3d Removed all traces of test pre-req requirements.
Generate the 'id' property from the 'path' property.
2011-09-24 11:46:26 -07:00
David Fugate 4fcd9a836d https://bugs.ecmascript.org/show_bug.cgi?id=34. Fixed 2011-09-23 16:27:46 -07:00
David Fugate 382f5c17e6 https://bugs.ecmascript.org/show_bug.cgi?id=5. Fixed 2011-09-23 15:10:53 -07:00
David Fugate 1b3e926837 Think I've come up with a fix for https://bugs.ecmascript.org/show_bug.cgi?id=11 (Date_library.js):
- juneDate and decemberDate were both one month off.  Fixed
- LocalTZA wasn't actually LocalTZA as defined in ES5.  If we were in DST when
  this was created, LocalTZA was off by one hour.  Fixed
- GetSundayInMonth was completely busted (i.e., arithmetic operations on the 'count'
  param which happens to be a string).  Fixed(?)
- DaylightSzavingTA was defined incorrectly.  It assumed the local time zone adjustment
  hadn't been accounted for.  This wasn't how UTC was calling it.  Fixed(?)
2011-09-22 11:58:06 -07:00