mirror of
https://github.com/tc39/test262.git
synced 2025-07-26 07:25:15 +02:00
Procedurally generate related tests
Take advantage of a recent extension to the test generation tool in order to limit duplication.
This commit is contained in:
parent
da4e798e5b
commit
f03c2c244c
22
src/accessor-names/literal-string-line-continuation.case
Normal file
22
src/accessor-names/literal-string-line-continuation.case
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
// Copyright (C) 2017 Mike Pennisi. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
desc: Computed values as accessor property names (string literal containing LineContinuation)
|
||||||
|
template: default
|
||||||
|
info: |
|
||||||
|
12.2.6.7 Runtime Semantics: Evaluation
|
||||||
|
|
||||||
|
[...]
|
||||||
|
|
||||||
|
ComputedPropertyName : [ AssignmentExpression ]
|
||||||
|
|
||||||
|
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||||
|
2. Let propName be ? GetValue(exprValue).
|
||||||
|
3. Return ? ToPropertyKey(propName).
|
||||||
|
---*/
|
||||||
|
|
||||||
|
//- declareWith
|
||||||
|
'line\
|
||||||
|
Continuation'
|
||||||
|
//- referenceWith
|
||||||
|
'lineContinuation'
|
@ -1,9 +1,11 @@
|
|||||||
// Copyright (C) 2017 Mike Pennisi. All rights reserved.
|
// This file was procedurally generated from the following sources:
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// - src/accessor-names/literal-string-line-continuation.case
|
||||||
|
// - src/accessor-names/default/cls-expr-inst.template
|
||||||
/*---
|
/*---
|
||||||
description: Computed values as accessor property names (string literal containing a line terminator) (Class expression, instance method)
|
description: Computed values as accessor property names (string literal containing LineContinuation) (Class expression, instance method)
|
||||||
esid: sec-runtime-semantics-classdefinitionevaluation
|
esid: sec-runtime-semantics-classdefinitionevaluation
|
||||||
es6id: 14.5.14
|
es6id: 14.5.14
|
||||||
|
flags: [generated]
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
21. For each ClassElement m in order from methods
|
21. For each ClassElement m in order from methods
|
||||||
@ -26,14 +28,12 @@ var stringSet;
|
|||||||
|
|
||||||
var C = class {
|
var C = class {
|
||||||
get 'line\
|
get 'line\
|
||||||
Terminator'
|
Continuation'() { return 'get string'; }
|
||||||
() { return 'get string'; }
|
|
||||||
set 'line\
|
set 'line\
|
||||||
Terminator'
|
Continuation'(param) { stringSet = param; }
|
||||||
(param) { stringSet = param; }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
assert.sameValue(C.prototype['lineTerminator'], 'get string');
|
assert.sameValue(C.prototype['lineContinuation'], 'get string');
|
||||||
|
|
||||||
C.prototype['lineTerminator'] = 'set string';
|
C.prototype['lineContinuation'] = 'set string';
|
||||||
assert.sameValue(stringSet, 'set string');
|
assert.sameValue(stringSet, 'set string');
|
@ -1,9 +1,11 @@
|
|||||||
// Copyright (C) 2017 Mike Pennisi. All rights reserved.
|
// This file was procedurally generated from the following sources:
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// - src/accessor-names/literal-string-line-continuation.case
|
||||||
|
// - src/accessor-names/default/cls-expr-static.template
|
||||||
/*---
|
/*---
|
||||||
description: Computed values as accessor property names (string literal containing a line terminator) (Class expression, static method)
|
description: Computed values as accessor property names (string literal containing LineContinuation) (Class expression, static method)
|
||||||
esid: sec-runtime-semantics-classdefinitionevaluation
|
esid: sec-runtime-semantics-classdefinitionevaluation
|
||||||
es6id: 14.5.14
|
es6id: 14.5.14
|
||||||
|
flags: [generated]
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
21. For each ClassElement m in order from methods
|
21. For each ClassElement m in order from methods
|
||||||
@ -28,14 +30,12 @@ var stringSet;
|
|||||||
|
|
||||||
var C = class {
|
var C = class {
|
||||||
static get 'line\
|
static get 'line\
|
||||||
Terminator'
|
Continuation'() { return 'get string'; }
|
||||||
() { return 'get string'; }
|
|
||||||
static set 'line\
|
static set 'line\
|
||||||
Terminator'
|
Continuation'(param) { stringSet = param; }
|
||||||
(param) { stringSet = param; }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
assert.sameValue(C['lineTerminator'], 'get string');
|
assert.sameValue(C['lineContinuation'], 'get string');
|
||||||
|
|
||||||
C['lineTerminator'] = 'set string';
|
C['lineContinuation'] = 'set string';
|
||||||
assert.sameValue(stringSet, 'set string');
|
assert.sameValue(stringSet, 'set string');
|
@ -1,9 +1,11 @@
|
|||||||
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
// This file was procedurally generated from the following sources:
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// - src/accessor-names/literal-string-line-continuation.case
|
||||||
|
// - src/accessor-names/default/obj.template
|
||||||
/*---
|
/*---
|
||||||
description: Computed values as accessor property names (string literal containing a line terminator) (Object initializer)
|
description: Computed values as accessor property names (string literal containing LineContinuation) (Object initializer)
|
||||||
esid: sec-object-initializer-runtime-semantics-evaluation
|
esid: sec-object-initializer-runtime-semantics-evaluation
|
||||||
es6id: 12.2.6.8
|
es6id: 12.2.6.8
|
||||||
|
flags: [generated]
|
||||||
info: |
|
info: |
|
||||||
ObjectLiteral :
|
ObjectLiteral :
|
||||||
{ PropertyDefinitionList }
|
{ PropertyDefinitionList }
|
||||||
@ -27,14 +29,12 @@ info: |
|
|||||||
var stringSet;
|
var stringSet;
|
||||||
var obj = {
|
var obj = {
|
||||||
get ['line\
|
get ['line\
|
||||||
Terminator'
|
Continuation']() { return 'get string'; },
|
||||||
]() { return 'get string'; },
|
|
||||||
set ['line\
|
set ['line\
|
||||||
Terminator'
|
Continuation'](param) { stringSet = param; }
|
||||||
](param) { stringSet = param; }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
assert.sameValue(obj['lineTerminator'], 'get string');
|
assert.sameValue(obj['lineContinuation'], 'get string');
|
||||||
|
|
||||||
obj['lineTerminator'] = 'set string';
|
obj['lineContinuation'] = 'set string';
|
||||||
assert.sameValue(stringSet, 'set string');
|
assert.sameValue(stringSet, 'set string');
|
@ -1,9 +1,11 @@
|
|||||||
// Copyright (C) 2017 Mike Pennisi. All rights reserved.
|
// This file was procedurally generated from the following sources:
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// - src/accessor-names/literal-string-line-continuation.case
|
||||||
|
// - src/accessor-names/default/cls-decl-inst.template
|
||||||
/*---
|
/*---
|
||||||
description: Computed values as accessor property names (string literal containing a line terminator) (Class declaration, instance method)
|
description: Computed values as accessor property names (string literal containing LineContinuation) (Class declaration, instance method)
|
||||||
esid: sec-runtime-semantics-classdefinitionevaluation
|
esid: sec-runtime-semantics-classdefinitionevaluation
|
||||||
es6id: 14.5.14
|
es6id: 14.5.14
|
||||||
|
flags: [generated]
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
21. For each ClassElement m in order from methods
|
21. For each ClassElement m in order from methods
|
||||||
@ -26,14 +28,12 @@ var stringSet;
|
|||||||
|
|
||||||
class C {
|
class C {
|
||||||
get 'line\
|
get 'line\
|
||||||
Terminator'
|
Continuation'() { return 'get string'; }
|
||||||
() { return 'get string'; }
|
|
||||||
set 'line\
|
set 'line\
|
||||||
Terminator'
|
Continuation'(param) { stringSet = param; }
|
||||||
(param) { stringSet = param; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.sameValue(C.prototype['lineTerminator'], 'get string');
|
assert.sameValue(C.prototype['lineContinuation'], 'get string');
|
||||||
|
|
||||||
C.prototype['lineTerminator'] = 'set string';
|
C.prototype['lineContinuation'] = 'set string';
|
||||||
assert.sameValue(stringSet, 'set string');
|
assert.sameValue(stringSet, 'set string');
|
@ -1,9 +1,11 @@
|
|||||||
// Copyright (C) 2017 Mike Pennisi. All rights reserved.
|
// This file was procedurally generated from the following sources:
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// - src/accessor-names/literal-string-line-continuation.case
|
||||||
|
// - src/accessor-names/default/cls-decl-static.template
|
||||||
/*---
|
/*---
|
||||||
description: Computed values as accessor property names (string literal containing a line terminator) (Class declaration, static method)
|
description: Computed values as accessor property names (string literal containing LineContinuation) (Class declaration, static method)
|
||||||
esid: sec-runtime-semantics-classdefinitionevaluation
|
esid: sec-runtime-semantics-classdefinitionevaluation
|
||||||
es6id: 14.5.14
|
es6id: 14.5.14
|
||||||
|
flags: [generated]
|
||||||
info: |
|
info: |
|
||||||
[...]
|
[...]
|
||||||
21. For each ClassElement m in order from methods
|
21. For each ClassElement m in order from methods
|
||||||
@ -28,14 +30,12 @@ var stringSet;
|
|||||||
|
|
||||||
class C {
|
class C {
|
||||||
static get 'line\
|
static get 'line\
|
||||||
Terminator'
|
Continuation'() { return 'get string'; }
|
||||||
() { return 'get string'; }
|
|
||||||
static set 'line\
|
static set 'line\
|
||||||
Terminator'
|
Continuation'(param) { stringSet = param; }
|
||||||
(param) { stringSet = param; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.sameValue(C['lineTerminator'], 'get string');
|
assert.sameValue(C['lineContinuation'], 'get string');
|
||||||
|
|
||||||
C['lineTerminator'] = 'set string';
|
C['lineContinuation'] = 'set string';
|
||||||
assert.sameValue(stringSet, 'set string');
|
assert.sameValue(stringSet, 'set string');
|
Loading…
x
Reference in New Issue
Block a user