Fix codecheck snake variable name and update testcase

issue: https://gitee.com/openharmony/third_party_typescript/issues/IAAIET

1. fix testcase codecheck.
2. update testcase file.

Change-Id: Ia5500555c65c6c255e37a5e9b37f8c46dfd37ae5
Signed-off-by: lizhonghan <lizhonghan1@huawei.com>
This commit is contained in:
lizhonghan 2024-07-04 11:30:04 +08:00
parent 0d49f48d84
commit 87c8e709be
2 changed files with 170 additions and 80 deletions

View File

@ -13,53 +13,59 @@
* limitations under the License.
*/
enum E1 {
str = '5'
}
enum E {
str = 'e5'
enum E2 {
num = 6
}
interface I {
one: string,
2: string, // ERROR v1.1
'3': string, // OK v1.1 rule relax case
[E.str]: string; // OK v1.1 rule relax case
2: string, // ERROR
'3': string, // OK
[E1.str]: string, // OK
[E2.num]: string // ERROR
}
let v1: I = {
let vOne1: I = {
one: 'i1',
2: 'i2', // ERROR v1.1
'3': 'i3', // OK v1.1
[E.str]: 'e5' // OK v1.1
2: 'i2', // ERROR
'3': 'i3', // OK
[E1.str]: 'e5', // OK
[E2.num]: 'e6' // ERROR
}
let v1_2: I = {
let vOne2: I = {
one: 'i1',
2: 'i2', // ERROR v1.1
'3': 'i3', // OK v1.1
'e5': 'e5' // OK v1.1
2: 'i2', // ERROR
'3': 'i3', // OK
'5': 'e5', // OK
6: 'e6' // ERROR
}
class C {
public one?: string = 'c1';
public 3?: string = 'c3'; // ERROR v1.1
public '4': string = 'c4'; // OK v1.1 rule relax case
public [E.str]: string = 'e5'; // OK v1.1 rule relax case
public one?: string = 'c1';
public 3?: string = 'c3'; // ERROR
public '4': string = 'c4'; // OK
public [E1.str]: string = 'e5'; // OK
public [E2.num]: string = 'e6'; // ERROR
}
let v2_1: C = {
let vTwo1: C = {
one: 'c1',
3: 'c3', // ERROR v1.1
'4': 'c4', // OK v1.1
'e5': 'e5' // OK v1.1
3: 'c3', // ERROR
'4': 'c4', // OK
[E1.str]: 'e5', // OK
[E2.num]: 'e6' // ERROR
}
let v2_2: C = {
let vTwo2: C = {
one: 'c1',
3: 'c3', // ERROR v1.1
'4': 'c4', // OK v1.1
[E.str]: 'e5' // OK v1.1
}
export let other = 1;
3: 'c3', // ERROR
'4': 'c4', // OK
'5': 'e5', // OK
6: 'e6' // ERROR
}

View File

@ -3,43 +3,43 @@
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 25,
"line": 28,
"character": 3
}
},
{
"messageText": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)",
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 29,
"character": 13
}
},
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 31,
"character": 3
}
},
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 32,
"character": 3
}
},
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 33,
"character": 3
}
},
{
"messageText": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)",
"expectLineAndCharacter": {
"line": 32,
"character": 16
}
},
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 34,
"character": 3
}
},
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 35,
"character": 15
"character": 3
}
},
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 36,
"character": 3
}
},
{
@ -49,17 +49,31 @@
"character": 3
}
},
{
"messageText": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)",
"expectLineAndCharacter": {
"line": 40,
"character": 16
}
},
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 38,
"line": 42,
"character": 3
}
},
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 39,
"line": 43,
"character": 3
}
},
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 44,
"character": 3
}
},
@ -73,24 +87,10 @@
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 46,
"line": 51,
"character": 3
}
},
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 47,
"character": 10
}
},
{
"messageText": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)",
"expectLineAndCharacter": {
"line": 50,
"character": 15
}
},
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
@ -102,21 +102,21 @@
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 53,
"character": 3
"character": 10
}
},
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 54,
"character": 3
"character": 10
}
},
{
"messageText": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)",
"expectLineAndCharacter": {
"line": 57,
"character": 15
"character": 16
}
},
{
@ -139,20 +139,69 @@
"line": 61,
"character": 3
}
}
],
"arktsVersion_1_1": [
},
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 23,
"line": 62,
"character": 3
}
},
{
"messageText": "Object literal must correspond to some explicitly declared class or interface (arkts-no-untyped-obj-literals)",
"expectLineAndCharacter": {
"line": 65,
"character": 16
}
},
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 67,
"character": 3
}
},
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 31,
"line": 68,
"character": 3
}
},
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 69,
"character": 3
}
},
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 70,
"character": 3
}
}
],
"arktsVersion_1_1": [
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 26,
"character": 3
}
},
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 29,
"character": 3
}
},
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 34,
"character": 3
}
},
@ -163,6 +212,13 @@
"character": 3
}
},
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 42,
"character": 3
}
},
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
@ -173,16 +229,44 @@
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 52,
"line": 51,
"character": 3
}
},
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 54,
"character": 10
}
},
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 59,
"character": 3
}
},
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 62,
"character": 3
}
},
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 67,
"character": 3
}
},
{
"messageText": "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)",
"expectLineAndCharacter": {
"line": 70,
"character": 3
}
}
]
}