mirror of
https://gitee.com/openharmony/developtools_ace_ets2bundle
synced 2024-12-04 07:22:30 +00:00
update ut for validate Signed-off-by: s00912778 <shijiakai2@huawei.com> Change-Id: I943ad2186224def13226dd04bcf80b6331f19591
This commit is contained in:
parent
c30ba3fc8c
commit
899805408e
@ -154,11 +154,11 @@
|
||||
"type": "WARN"
|
||||
},
|
||||
"validateForbiddenToInitViaParam": {
|
||||
"message": "Property 'message' in the custom component 'Child' cannot be initialized here (forbidden to specify).",
|
||||
"message": "Property 'message' in the custom component 'ValidateForbiddenToInitViaParamChild' cannot be initialized here (forbidden to specify).",
|
||||
"type": "ERROR"
|
||||
},
|
||||
"validateMandatoryToInitViaParam": {
|
||||
"message": "Property 'message' in the custom component 'Child' is missing (mandatory to specify).",
|
||||
"message": "Property 'message' in the custom component 'ValidateMandatoryToInitViaParamChild' is missing (mandatory to specify).",
|
||||
"type": "ERROR"
|
||||
},
|
||||
"validateInitDecorator": [
|
||||
|
@ -1,10 +1,13 @@
|
||||
class param {
|
||||
paramA1: string = ""
|
||||
}
|
||||
@Entry
|
||||
@Component
|
||||
struct Parent {
|
||||
struct CheckBuilderParent {
|
||||
@State label: string = 'Hello';
|
||||
|
||||
@Builder ABuilder($$: { paramA1: string }) {
|
||||
Child({ message: $$.paramA1 })
|
||||
@Builder ABuilder($$: param) {
|
||||
CheckBuilderChild({ message: $$.paramA1 })
|
||||
}
|
||||
|
||||
build() {
|
||||
@ -16,7 +19,7 @@ struct Parent {
|
||||
}
|
||||
|
||||
@Component
|
||||
struct Child {
|
||||
struct CheckBuilderChild {
|
||||
@Link message: string
|
||||
|
||||
build() {
|
||||
|
@ -1,17 +1,17 @@
|
||||
@Entry
|
||||
@Component
|
||||
struct Parent {
|
||||
struct ValidateForbiddenToInitViaParamParent {
|
||||
@StorageProp('111') message: string = 'Hello';
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
Child({message: this.message});
|
||||
ValidateForbiddenToInitViaParamChild({message: this.message});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Component
|
||||
struct Child {
|
||||
struct ValidateForbiddenToInitViaParamChild {
|
||||
@StorageProp('111') message: string = 'Hello';
|
||||
build() {
|
||||
|
||||
|
@ -1,17 +1,17 @@
|
||||
@Entry
|
||||
@Component
|
||||
struct Parent {
|
||||
struct ValidateIllegalInitFromParentParent {
|
||||
private message: string ='Hello';
|
||||
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
Child({message: $message});
|
||||
ValidateIllegalInitFromParentChild({message: $message});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Component
|
||||
struct Child {
|
||||
struct ValidateIllegalInitFromParentChild {
|
||||
@Link message: string;
|
||||
build() {
|
||||
Row() {}
|
||||
|
@ -1,18 +1,18 @@
|
||||
@Entry
|
||||
@Component
|
||||
struct Parent {
|
||||
struct ValidateInitDecoratorParent {
|
||||
@State message: string ='Hello';
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
Child();
|
||||
ValidateInitDecoratorChild();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Component
|
||||
struct Child {
|
||||
@Require regular_value: string
|
||||
struct ValidateInitDecoratorChild {
|
||||
@Require regular_value: string = "hello"
|
||||
@Require @State state_value: string = "hello"
|
||||
@Require @Provide provide_value: string = "hello"
|
||||
@Require @Prop prop_value: string
|
||||
@ -20,4 +20,4 @@ struct Child {
|
||||
build() {
|
||||
Row() {}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,17 +1,17 @@
|
||||
@Entry
|
||||
@Component
|
||||
struct Parent {
|
||||
struct ValidateMandatoryToInitViaParamParent {
|
||||
@State message: string ='Hello';
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
Child();
|
||||
ValidateMandatoryToInitViaParamChild();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Component
|
||||
struct Child {
|
||||
struct ValidateMandatoryToInitViaParamChild {
|
||||
@Link message: string
|
||||
build() {
|
||||
Row() {}
|
||||
|
@ -1,17 +1,17 @@
|
||||
@Entry
|
||||
@Component
|
||||
struct Parent {
|
||||
struct ValidateNonLinkWithDollarParent {
|
||||
@State message: string ='Hello';
|
||||
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
Child({message: $message});
|
||||
ValidateNonLinkWithDollarChild({message: $message});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Component
|
||||
struct Child {
|
||||
struct ValidateNonLinkWithDollarChild {
|
||||
@Prop message: string;
|
||||
build() {
|
||||
Row() {}
|
||||
|
@ -1,18 +1,21 @@
|
||||
const gloabel_value: string = "Foo"
|
||||
const obj = {
|
||||
const obj: paramA = {
|
||||
gloabel_value: "Foo"
|
||||
}
|
||||
class paramA {
|
||||
gloabel_value: string = "Foo"
|
||||
}
|
||||
@Entry
|
||||
@ComponentV2
|
||||
struct validateParamTwoWayBind {
|
||||
@Local local_value: string = "Foo"
|
||||
obj = {
|
||||
obj: paramA = {
|
||||
gloabel_value: "Foo"
|
||||
}
|
||||
aa() {
|
||||
return {
|
||||
gloabel_value: "Foo"
|
||||
}
|
||||
} as paramA
|
||||
}
|
||||
bb() {
|
||||
return "Foo";
|
||||
@ -39,4 +42,4 @@ struct testParamChild2 {
|
||||
@Param paramValue: string = "hello"
|
||||
@Event $paramValue: (value: string) => void = (value: string) => {}
|
||||
build() {}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user