diff --git a/compiler/test/error.json b/compiler/test/error.json index a9c3f8cd6..e25c3a114 100644 --- a/compiler/test/error.json +++ b/compiler/test/error.json @@ -184,7 +184,7 @@ "type": "ERROR" }, "notConcurrent": { - "message": "The struct 'IndexDecorator' use invalid decorator.", + "message": "The struct 'NotConcurrentIndexDecorator' use invalid decorator.", "type": "WARN" }, "notConcurrentFun": { @@ -200,7 +200,7 @@ "type": "WARN" }, "vaildateDecorator": { - "message": "The struct 'Index' use invalid decorator.", + "message": "The struct 'VaildateDecoratorIndex' use invalid decorator.", "type": "WARN" }, "state": { diff --git a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/@Monitor.ts b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/@Monitor.ts index 6cbac69ca..aca59f0b8 100644 --- a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/@Monitor.ts +++ b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/@Monitor.ts @@ -16,7 +16,7 @@ exports.source = ` @Entry @Component -struct HomeComponent { +struct MonitorHomeComponent { build() { Column() {} diff --git a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/ExceededEntry.ts b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/ExceededEntry.ts index 34bfa580e..649046a81 100644 --- a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/ExceededEntry.ts +++ b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/ExceededEntry.ts @@ -16,7 +16,7 @@ exports.source = ` @Entry @Component -struct summerpockets { +struct ExceededEntrySummerpockets { build(){ } @@ -24,7 +24,7 @@ struct summerpockets { @Entry @Component -struct ever17 { +struct ExceededEntryEver17 { build(){ } diff --git a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/ExceededPreview.ts b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/ExceededPreview.ts index ad0ac65c5..4fd308a71 100644 --- a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/ExceededPreview.ts +++ b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/ExceededPreview.ts @@ -17,7 +17,7 @@ exports.source = ` @Entry @Preview @Component -struct summerpockets { +struct ExceededPreviewSummerpockets { build(){ } @@ -25,7 +25,7 @@ struct summerpockets { @Preview @Component -struct ever17 { +struct ExceededPreviewEver17 { build(){ } diff --git a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/MethodNoExtend.ts b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/MethodNoExtend.ts index 24ca383cb..89e7a9018 100644 --- a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/MethodNoExtend.ts +++ b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/MethodNoExtend.ts @@ -16,7 +16,7 @@ exports.source = ` @Entry @Component -struct summerpockets { +struct MethodNoExtendSummerpockets { @Extend build(){ diff --git a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/NoStructDeco.ts b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/NoStructDeco.ts index 780ef4252..0d40bd33a 100644 --- a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/NoStructDeco.ts +++ b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/NoStructDeco.ts @@ -15,13 +15,13 @@ exports.source = ` @Component -function nekopara () { +class nekopara { } @Entry @Component -struct summerpockets { +struct NoStructDecoSummerpockets { build(){ } } diff --git a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/OneEntry.ts b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/OneEntry.ts index c3fc2eb89..e52f80633 100644 --- a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/OneEntry.ts +++ b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/OneEntry.ts @@ -15,7 +15,7 @@ exports.source = ` @Component -struct summerpockets { +struct OneEntrySummerpockets { build(){ } } diff --git a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/OnlyStructDeco.ts b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/OnlyStructDeco.ts index f0e5c3edc..6a0286c63 100644 --- a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/OnlyStructDeco.ts +++ b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/OnlyStructDeco.ts @@ -14,16 +14,16 @@ */ exports.source = ` -class bsd { - @Builder - bsd() { +class OnlyStructDecoBsd { + @Builder + OnlyStructDecoBsd() { } } @Entry @Component -struct summerpockets { +struct OnlyStructDecoSummerpockets { build(){ } } diff --git a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/StylesDuplicate.ts b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/StylesDuplicate.ts index 5d331a21a..5dca2a060 100644 --- a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/StylesDuplicate.ts +++ b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/StylesDuplicate.ts @@ -14,9 +14,11 @@ */ exports.source = ` +@Entry +@Component @Concurrent struct StylesDuplicate{ - @State @opacity: string = 'Hello Word' + @State message:string = 'Hello Word' build(){ Row(){ Column(){ diff --git a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/notConcurrent.ts b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/notConcurrent.ts index 9118eed5e..b857a98b5 100644 --- a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/notConcurrent.ts +++ b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/notConcurrent.ts @@ -14,8 +14,9 @@ */ exports.source = ` +@Entry @Concurrent -struct IndexDecorator{ +struct NotConcurrentIndexDecorator{ build(){ Column(){ Text('hello') diff --git a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/notConcurrentFun.ts b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/notConcurrentFun.ts index df95fb6b8..b088ccf88 100644 --- a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/notConcurrentFun.ts +++ b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/notConcurrentFun.ts @@ -16,9 +16,8 @@ exports.source = ` @Entry @Component -struct StylesDuplicate{ - @State @opacity: string = 'Hello Word' - @Concurrent conFun() +struct notConcurrentFun{ + @Concurrent conFun(){} build(){ Row(){ Column(){ @@ -28,9 +27,7 @@ struct StylesDuplicate{ .height('100%') } } -conFun(){ -} function conFun() { -throw new Error('Function not implemented.') + throw new Error('Function not implemented.') } ` diff --git a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/notDecorator.ts b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/notDecorator.ts index a70f8cb04..ea4dce4a2 100644 --- a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/notDecorator.ts +++ b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/notDecorator.ts @@ -14,6 +14,8 @@ */ exports.source = ` +@Entry +@Component @IndexDecorator struct IndexDecorator{ build(){ diff --git a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/state.ts b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/state.ts index 68b891823..ff5deba82 100644 --- a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/state.ts +++ b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/state.ts @@ -14,6 +14,7 @@ */ exports.source = ` +@Entry @Component struct Button{ @State message:string = 'Hello Word' diff --git a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/v2MemberDecorator.ts b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/v2MemberDecorator.ts index 344a30480..708d63675 100644 --- a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/v2MemberDecorator.ts +++ b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/v2MemberDecorator.ts @@ -25,7 +25,7 @@ struct v2MemberDecorator { @Computed bb() {} - @Monitor("user") get value() {} + @Monitor("user") get value(){ return "" } build() { Column() diff --git a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/vaildateDecorator.ts b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/vaildateDecorator.ts index 3beecc1a1..614e6f356 100644 --- a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/vaildateDecorator.ts +++ b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/vaildateDecorator.ts @@ -14,8 +14,9 @@ */ exports.source = ` +@Entry @Concurrent -struct Index{ +struct VaildateDecoratorIndex{ build(){ Column(){ Text('hello') diff --git a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/validateAccessQualifier.ts b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/validateAccessQualifier.ts index 00451f7ec..eb9eb1622 100644 --- a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/validateAccessQualifier.ts +++ b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/validateAccessQualifier.ts @@ -16,7 +16,7 @@ exports.source = ` @Entry @Component -struct HomeComponent { +struct ValidateAccessQualifierHomeComponent { @State message: string = "hello" build() { diff --git a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/validateDifferentMethod.ts b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/validateDifferentMethod.ts index 0199ba831..fd2603ad8 100644 --- a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/validateDifferentMethod.ts +++ b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/validateDifferentMethod.ts @@ -14,9 +14,11 @@ */ exports.source = ` +declare const CustomMethod: PropertyDecorator; + @Entry @Component -struct HomeComponent { +struct ValidateDifferentMethodHomeComponent { build() { Column() {} } @@ -44,7 +46,7 @@ function testFunction3() { } @Component -struct TestComponent { +struct ValidateDifferentMethodTestComponent { build() { } @@ -63,7 +65,7 @@ struct TestComponent { } @ComponentV2 -struct TestComponent1 { +struct ValidateDifferentMethodTestComponent1 { build() { } diff --git a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/validateDuplicateMethod.ts b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/validateDuplicateMethod.ts index 669e650d5..52edf538c 100644 --- a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/validateDuplicateMethod.ts +++ b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/validateDuplicateMethod.ts @@ -14,22 +14,24 @@ */ exports.source = ` +declare const CustomMethod: PropertyDecorator; + @Entry @Component -struct HomeComponent { +struct ValidateDuplicateMethodHomeComponent { build() { Column() {} } } @Builder @Builder -function testFunction1() { +function testFunction4() { Text("testFunction1") } @CustomMethod @CustomMethod -function testFunction2() { +function testFunction5() { console.log("testFunction2") } diff --git a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/validate_track_observed.ts b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/validate_track_observed.ts index 781a9f154..87b0b7e3d 100644 --- a/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/validate_track_observed.ts +++ b/compiler/test/utForValidate/Decorators/vaildate_ui_syntax/validate_track_observed.ts @@ -16,8 +16,8 @@ exports.source = ` @Entry @Component -struct HomeComponent { - @Trace value: string +struct ValidateTrackObservedHomeComponent { + @Trace value: string = ''; build() { Column() { Text("hello") @@ -35,11 +35,11 @@ struct child { } class A { - @Trace value: string + @Trace value: string = ''; } @ObservedV2 class B { - @Trace value: string + @Trace value: string = ''; } `;