mirror of https://github.com/tc39/test262.git
Rename negative test "phase" for module resolution
This commit is contained in:
parent
136110378b
commit
e6d674ef7a
|
@ -103,7 +103,7 @@ single line comment syntax.
|
|||
This means the test is expected to throw an error of the given type. If no error is thrown, a test failure is reported.
|
||||
|
||||
- **type**- If an error is thrown, it is implicitly converted to a string. In order for the test to pass, this value must match the name of the error constructor.
|
||||
- **phase** - Negative tests whose **phase** value is "parse" must produce the specified error prior to executing code. The value "runtime" dictates that the error is expected to be produced as a result of executing the test code.
|
||||
- **phase** - Negative tests whose **phase** value is "parse" must produce the specified error prior to executing code. The value "resolution" indicates that the error is expected to result while performing ES2015 module resolution. The value "runtime" dictates that the error is expected to be produced as a result of executing the test code.
|
||||
|
||||
For best practices on how to use the negative tag please see [Handling Errors and Negative Test Cases](#handling-errors-and-negative-test-cases), below.
|
||||
|
||||
|
|
|
@ -162,8 +162,9 @@ attribute is a YAML dictonary with two keys:
|
|||
|
||||
- `phase` - the stage of the test interpretation process that the error is
|
||||
expected to be produced; either "parse" (meaning, "while parsing the source
|
||||
text"), "early" (meaning, "prior to evaluation") or "runtime" (meaning,
|
||||
"during evaluation")
|
||||
text"), "early" (meaning, "prior to evaluation"), "resolution" (meaining,
|
||||
"during ES2015 module resolution"), or "runtime" (meaning, "during
|
||||
evaluation")
|
||||
- `type` - the name of the constructor of the expected error
|
||||
|
||||
If a test configured with the `negative` attribute completes without throwing
|
||||
|
|
|
@ -30,7 +30,7 @@ info: |
|
|||
{ ExportsList }
|
||||
{ ExportsList , }
|
||||
negative:
|
||||
phase: early
|
||||
phase: resolution
|
||||
type: ReferenceError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
|
|
@ -36,7 +36,7 @@ info: |
|
|||
{ ImportsList }
|
||||
{ ImportsList , }
|
||||
negative:
|
||||
phase: early
|
||||
phase: resolution
|
||||
type: ReferenceError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
|
|
@ -11,7 +11,7 @@ info: |
|
|||
b. Let requiredModule be ? HostResolveImportedModule(module, required).
|
||||
[...]
|
||||
negative:
|
||||
phase: early
|
||||
phase: resolution
|
||||
type: ReferenceError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
|
|
@ -11,7 +11,7 @@ info: |
|
|||
b. Let requiredModule be ? HostResolveImportedModule(module, required).
|
||||
[...]
|
||||
negative:
|
||||
phase: early
|
||||
phase: resolution
|
||||
type: SyntaxError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
description: Module dependencies are resolved following a depth-first strategy
|
||||
esid: sec-moduledeclarationinstantiation
|
||||
negative:
|
||||
phase: early
|
||||
phase: resolution
|
||||
type: ReferenceError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
description: Modules dependencies are resolved in source text order
|
||||
esid: sec-moduledeclarationinstantiation
|
||||
negative:
|
||||
phase: early
|
||||
phase: resolution
|
||||
type: ReferenceError
|
||||
flags: [module]
|
||||
---*/
|
||||
|
|
|
@ -23,5 +23,5 @@ class CheckNegative(Check):
|
|||
if not 'phase' in negative:
|
||||
return '"negative" must specify a "phase" field'
|
||||
|
||||
if negative["phase"] == "parse" and not _THROW_STMT.search(source):
|
||||
if negative["phase"] in ["parse", "resolution"] and not _THROW_STMT.search(source):
|
||||
return 'Negative tests of type "early" must include a `throw` statement'
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
NEGATIVE
|
||||
^ expected errors | v input
|
||||
// Copyright (C) 2017 Mike Pennisi. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
esid: sec-assignment-operators-static-semantics-early-errors
|
||||
description: Minimal test
|
||||
flags: [module]
|
||||
negative:
|
||||
type: SyntaxError
|
||||
phase: resolution
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated!";
|
||||
|
||||
import 'non-existent-module.js';
|
|
@ -0,0 +1,14 @@
|
|||
NEGATIVE
|
||||
^ expected errors | v input
|
||||
// Copyright (C) 2017 Mike Pennisi. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
esid: sec-assignment-operators-static-semantics-early-errors
|
||||
description: Minimal test
|
||||
flags: [module]
|
||||
negative:
|
||||
type: SyntaxError
|
||||
phase: resolution
|
||||
---*/
|
||||
|
||||
import 'non-existent-module.js';
|
|
@ -0,0 +1,15 @@
|
|||
^ expected errors | v input
|
||||
// Copyright (C) 2017 Mike Pennisi. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
esid: sec-assignment-operators-static-semantics-early-errors
|
||||
description: Minimal test
|
||||
flags: [module]
|
||||
negative:
|
||||
type: SyntaxError
|
||||
phase: resolution
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
import 'non-existent-module.js';
|
Loading…
Reference in New Issue