Skip to content

Commit

Permalink
Fix code formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Patryk Wrobel <[email protected]>
  • Loading branch information
pwrobeldev committed Nov 29, 2024
1 parent 5d0268a commit 92fe3d3
Showing 1 changed file with 30 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@ class DartDefaultValuesValidatorTest {
fun validateStructWithoutPositionalDefaults() {
// Given a structure that is not annotated with 'PositionalDefaults'
// and has nullable field with default value different from 'null'.
val field = LimeField(
path = typePath.child("someField"),
typeRef = LimeDirectTypeRef(type = anotherType, isNullable = true),
defaultValue = LimeValue.StructInitializer(LimeDirectTypeRef(type = anotherType, isNullable = true), listOf())
)
val field =
LimeField(
path = typePath.child("someField"),
typeRef = LimeDirectTypeRef(type = anotherType, isNullable = true),
defaultValue = LimeValue.StructInitializer(LimeDirectTypeRef(type = anotherType, isNullable = true), listOf()),
)

val structWithFields = LimeStruct(path = typePath, fields = listOf(field))
allElements[typePath.toString()] = structWithFields
Expand All @@ -76,11 +77,12 @@ class DartDefaultValuesValidatorTest {
fun validatePositionalDefaultsStructThatDoesNotHaveStructFields() {
// Given a structure that is annotated with 'PositionalDefaults'
// and has nullable field that is not struct and has value different from 'null'.
val field = LimeField(
path = typePath.child("someField"),
typeRef = LimeBasicTypeRef(LimeBasicType.TypeId.INT32, isNullable = true),
defaultValue = LimeValue.Literal(LimeBasicTypeRef(LimeBasicType.TypeId.INT32, isNullable = true), "123")
)
val field =
LimeField(
path = typePath.child("someField"),
typeRef = LimeBasicTypeRef(LimeBasicType.TypeId.INT32, isNullable = true),
defaultValue = LimeValue.Literal(LimeBasicTypeRef(LimeBasicType.TypeId.INT32, isNullable = true), "123"),
)

val structWithFields = LimeStruct(path = typePath, fields = listOf(field), attributes = positionalDefaultsAttributes)
allElements[typePath.toString()] = structWithFields
Expand All @@ -96,11 +98,12 @@ class DartDefaultValuesValidatorTest {
fun validatePositionalDefaultsStructThatHasImmutableField() {
// Given a structure that is annotated with 'PositionalDefaults'
// and has nullable field annotated as immutable with default value different from 'null'.
val field = LimeField(
path = typePath.child("someField"),
typeRef = LimeDirectTypeRef(type = anotherImmutableType, isNullable = true),
defaultValue = LimeValue.StructInitializer(LimeDirectTypeRef(type = anotherImmutableType, isNullable = true), listOf())
)
val field =
LimeField(
path = typePath.child("someField"),
typeRef = LimeDirectTypeRef(type = anotherImmutableType, isNullable = true),
defaultValue = LimeValue.StructInitializer(LimeDirectTypeRef(type = anotherImmutableType, isNullable = true), listOf()),
)

val structWithFields = LimeStruct(path = typePath, fields = listOf(field), attributes = positionalDefaultsAttributes)
allElements[typePath.toString()] = structWithFields
Expand All @@ -116,11 +119,12 @@ class DartDefaultValuesValidatorTest {
fun validatePositionalDefaultsStructThatHasMutableStructFieldEqualsNull() {
// Given a structure that is annotated with 'PositionalDefaults'
// and has nullable field with default value equals 'null'.
val field = LimeField(
path = typePath.child("someField"),
typeRef = LimeDirectTypeRef(type = anotherType, isNullable = true),
defaultValue = LimeValue.Null(LimeDirectTypeRef(type = anotherType, isNullable = true))
)
val field =
LimeField(
path = typePath.child("someField"),
typeRef = LimeDirectTypeRef(type = anotherType, isNullable = true),
defaultValue = LimeValue.Null(LimeDirectTypeRef(type = anotherType, isNullable = true)),
)

val structWithFields = LimeStruct(path = typePath, fields = listOf(field), attributes = positionalDefaultsAttributes)
allElements[typePath.toString()] = structWithFields
Expand All @@ -136,11 +140,12 @@ class DartDefaultValuesValidatorTest {
fun validatePositionalDefaultsStructThatHasMutableStructFieldNotEqualNull() {
// Given a structure that is annotated with 'PositionalDefaults'
// and has nullable field with default value different from 'null'.
val field = LimeField(
path = typePath.child("someField"),
typeRef = LimeDirectTypeRef(type = anotherType, isNullable = true),
defaultValue = LimeValue.StructInitializer(LimeDirectTypeRef(type = anotherType, isNullable = true), listOf())
)
val field =
LimeField(
path = typePath.child("someField"),
typeRef = LimeDirectTypeRef(type = anotherType, isNullable = true),
defaultValue = LimeValue.StructInitializer(LimeDirectTypeRef(type = anotherType, isNullable = true), listOf()),
)

val structWithFields = LimeStruct(path = typePath, fields = listOf(field), attributes = positionalDefaultsAttributes)
allElements[typePath.toString()] = structWithFields
Expand Down

0 comments on commit 92fe3d3

Please sign in to comment.