mirror of https://github.com/tc39/test262.git
[generation] Parse and render new error format
Extend the test generation tool to emit the recently-modified format of the "negative" meta-data. Update the effected test case files accordingly.
This commit is contained in:
parent
0c29e6de86
commit
7f6e6d137d
|
@ -5,7 +5,9 @@ desc: >
|
|||
It is a Syntax Error if BoundNames of FormalParameters contains any duplicate
|
||||
elements.
|
||||
template: syntax
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: |
|
||||
14.1.2 Static Semantics: Early Errors
|
||||
|
||||
|
|
|
@ -20,7 +20,9 @@ info: |
|
|||
|
||||
...BindingIdentifier[?Yield]
|
||||
...BindingPattern[?Yield]
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- params
|
||||
|
|
|
@ -10,7 +10,9 @@ desc: >
|
|||
template: syntax
|
||||
es6id: 12.14.5.1
|
||||
flags: [onlyStrict]
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- elems
|
||||
|
|
|
@ -8,7 +8,9 @@ desc: >
|
|||
template: syntax
|
||||
es6id: 12.14.5.4
|
||||
flags: [onlyStrict]
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- elems
|
||||
|
|
|
@ -9,7 +9,9 @@ desc: >
|
|||
AssignmentPattern as the goal symbol.
|
||||
template: syntax
|
||||
es6id: 12.14.5.1
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- elems
|
||||
|
|
|
@ -9,7 +9,9 @@ desc: >
|
|||
template: syntax
|
||||
es6id: 12.14.5.3
|
||||
flags: [onlyStrict]
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- elems
|
||||
|
|
|
@ -9,7 +9,9 @@ desc: >
|
|||
AssignmentPattern as the goal symbol.
|
||||
template: syntax
|
||||
es6id: 12.14.5.1
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- elems
|
||||
|
|
|
@ -9,7 +9,9 @@ desc: >
|
|||
template: syntax
|
||||
es6id: 12.14.5.3
|
||||
flags: [onlyStrict]
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- elems
|
||||
|
|
|
@ -10,7 +10,9 @@ desc: >
|
|||
template: syntax
|
||||
es6id: 12.14.5.1
|
||||
flags: [onlyStrict]
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- elems
|
||||
|
|
|
@ -9,7 +9,9 @@ desc: >
|
|||
template: syntax
|
||||
es6id: 12.14.5.4
|
||||
flags: [onlyStrict]
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- elems
|
||||
|
|
|
@ -7,7 +7,9 @@ desc: >
|
|||
AssignmentElementList.
|
||||
template: syntax
|
||||
es6id: 12.14.5
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- elems
|
||||
|
|
|
@ -7,7 +7,9 @@ desc: >
|
|||
AssignmentElementList.
|
||||
template: syntax
|
||||
es6id: 12.14.5
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- elems
|
||||
|
|
|
@ -7,7 +7,9 @@ desc: >
|
|||
AssignmentElementList.
|
||||
template: syntax
|
||||
es6id: 12.14.5
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- elems
|
||||
|
|
|
@ -7,7 +7,9 @@ desc: >
|
|||
AssignmentRestElement in a AssignmentElementList.
|
||||
template: syntax
|
||||
es6id: 12.14.5
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- elems
|
||||
|
|
|
@ -6,7 +6,9 @@ desc: >
|
|||
The AssignmentRestElement does not support an initializer.
|
||||
template: syntax
|
||||
es6id: 12.14.5
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- setup
|
||||
|
|
|
@ -9,7 +9,9 @@ desc: >
|
|||
AssignmentPattern as the goal symbol.
|
||||
template: syntax
|
||||
es6id: 12.14.5.1
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- elems
|
||||
|
|
|
@ -9,7 +9,9 @@ desc: >
|
|||
template: syntax
|
||||
es6id: 12.14.5.3
|
||||
flags: [onlyStrict]
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- elems
|
||||
|
|
|
@ -9,7 +9,9 @@ desc: >
|
|||
AssignmentPattern as the goal symbol.
|
||||
template: syntax
|
||||
es6id: 12.14.5.1
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- elems
|
||||
|
|
|
@ -9,7 +9,9 @@ desc: >
|
|||
template: syntax
|
||||
es6id: 12.14.5.3
|
||||
flags: [onlyStrict]
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- elems
|
||||
|
|
|
@ -9,7 +9,9 @@ desc: >
|
|||
template: syntax
|
||||
es6id: 12.14.5
|
||||
flags: [onlyStrict]
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- setup
|
||||
|
|
|
@ -9,7 +9,9 @@ template: syntax
|
|||
es6id: 12.14.5
|
||||
flags: [noStrict]
|
||||
features: [generators]
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- setup
|
||||
|
|
|
@ -8,7 +8,9 @@ desc: >
|
|||
template: syntax
|
||||
es6id: 12.14.5
|
||||
flags: [onlyStrict]
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- elems
|
||||
|
|
|
@ -8,7 +8,9 @@ desc: >
|
|||
template: syntax
|
||||
es6id: 12.14.5.1
|
||||
flags: [onlyStrict]
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- elems
|
||||
|
|
|
@ -9,7 +9,9 @@ desc: >
|
|||
template: syntax
|
||||
es6id: 12.14.5
|
||||
flags: [onlyStrict]
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- elems
|
||||
|
|
|
@ -8,7 +8,9 @@ desc: >
|
|||
template: syntax
|
||||
es6id: 12.14.5.1
|
||||
flags: [onlyStrict]
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- elems
|
||||
|
|
|
@ -9,7 +9,9 @@ desc: >
|
|||
template: syntax
|
||||
es6id: 12.14.5.4
|
||||
flags: [onlyStrict]
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- elems
|
||||
|
|
|
@ -9,7 +9,9 @@ desc: >
|
|||
template: syntax
|
||||
es6id: 12.14.5.4
|
||||
flags: [onlyStrict]
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- elems
|
||||
|
|
|
@ -9,7 +9,9 @@ desc: >
|
|||
AssignmentPattern as the goal symbol.
|
||||
template: syntax
|
||||
es6id: 12.14.5.1
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- elems
|
||||
|
|
|
@ -9,7 +9,9 @@ desc: >
|
|||
template: syntax
|
||||
es6id: 12.14.5.4
|
||||
flags: [onlyStrict]
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- elems
|
||||
|
|
|
@ -10,7 +10,9 @@ desc: >
|
|||
the goal symbol.
|
||||
template: syntax
|
||||
es6id: 12.14.5.1
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- elems
|
||||
|
|
|
@ -9,7 +9,9 @@ desc: >
|
|||
template: syntax
|
||||
es6id: 12.14.5.4
|
||||
flags: [onlyStrict]
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
//- elems
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
/*---
|
||||
template: default
|
||||
desc: Reset element (nested array pattern) does not support initializer
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: >
|
||||
13.3.3 Destructuring Binding Patterns
|
||||
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
/*---
|
||||
template: default
|
||||
desc: Reset element (identifier) does not support initializer
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: >
|
||||
13.3.3 Destructuring Binding Patterns
|
||||
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
/*---
|
||||
template: default
|
||||
desc: Reset element (nested object pattern) does not support initializer
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: >
|
||||
13.3.3 Destructuring Binding Patterns
|
||||
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
/*---
|
||||
template: default
|
||||
desc: Rest element (array binding pattern) may not be followed by any element
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: >
|
||||
13.3.3 Destructuring Binding Patterns
|
||||
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
/*---
|
||||
template: default
|
||||
desc: Rest element (identifier) may not be followed by any element
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: >
|
||||
13.3.3 Destructuring Binding Patterns
|
||||
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
/*---
|
||||
template: default
|
||||
desc: Rest element (object binding pattern) may not be followed by any element
|
||||
negative: SyntaxError
|
||||
negative:
|
||||
phase: early
|
||||
type: SyntaxError
|
||||
info: >
|
||||
13.3.3 Destructuring Binding Patterns
|
||||
|
||||
|
|
|
@ -144,7 +144,10 @@ class Template:
|
|||
lines += ['includes: ' + yaml.dump(includes).strip()]
|
||||
|
||||
if case_values['meta'].get('negative'):
|
||||
lines += ['negative: ' + case_values['meta'].get('negative')]
|
||||
lines += ['negative:']
|
||||
as_yaml = yaml.dump(case_values['meta'].get('negative'),
|
||||
default_flow_style=False)
|
||||
lines += indent(as_yaml.strip(), ' ').split('\n')
|
||||
|
||||
info = []
|
||||
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - tools/generation/test/fixtures/negative.case
|
||||
// - tools/generation/test/fixtures/negative/negative.template
|
||||
/*---
|
||||
description: foobar (The "negative" field should be emitted in the output files)
|
||||
es6id: 1.2.3
|
||||
flags: [generated]
|
||||
negative:
|
||||
phase: early
|
||||
type: ReferenceError
|
||||
info: |
|
||||
case info
|
||||
---*/
|
|
@ -0,0 +1,10 @@
|
|||
// Copyright (C) 2016 Mike Pennisi. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
template: negative
|
||||
desc: foobar
|
||||
info: case info
|
||||
negative:
|
||||
phase: early
|
||||
type: ReferenceError
|
||||
---*/
|
|
@ -0,0 +1,7 @@
|
|||
// Copyright (C) 2016 Mike Pennisi. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
name: The "negative" field should be emitted in the output files
|
||||
path: negative/negative-
|
||||
es6id: 1.2.3
|
||||
---*/
|
|
@ -54,5 +54,10 @@ class TestGeneration(unittest.TestCase):
|
|||
self.assertEqual(result['returncode'], 0)
|
||||
self.compareTrees('normal')
|
||||
|
||||
def test_negative(self):
|
||||
result = self.fixture('negative.case')
|
||||
self.assertEqual(result['returncode'], 0)
|
||||
self.compareTrees('negative')
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
Loading…
Reference in New Issue