Skip to content

Commit

Permalink
Fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cedrickcooke committed Nov 1, 2024
1 parent ff05047 commit 50af3d7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 34 deletions.
18 changes: 6 additions & 12 deletions compile/src/test/kotlin/ExerciseProcessorActivityTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -295,13 +295,11 @@ public class ExerciseProcessorActivityTests : ExerciseProcessorTests() {
import kotlin.Int
import kotlin.String
public fun bundleForOptionalsActivity(context: Context, optionalInt: Int? = null): Bundle =
bundleOf(
public fun bundleForOptionalsActivity(context: Context, optionalInt: Int? = null): Bundle = bundleOf(
"${"$"}{context.packageName}.optionalInt" to optionalInt
)
public fun bundleForOptionalsActivity(packageName: String, optionalInt: Int? = null): Bundle =
bundleOf(
public fun bundleForOptionalsActivity(packageName: String, optionalInt: Int? = null): Bundle = bundleOf(
"${"${'$'}"}{packageName}.optionalInt" to optionalInt
)
Expand Down Expand Up @@ -329,8 +327,7 @@ public class ExerciseProcessorActivityTests : ExerciseProcessorTests() {
public val optionalInt: Int?
get() = instance.intent?.extras?.get("${"$"}{instance.packageName}.optionalInt") as Int?
public fun optionalInt(default: Int): Int =
(instance.intent?.extras?.get("${"$"}{instance.packageName}.optionalInt") as? Int?) ?: default
public fun optionalInt(default: Int): Int = (instance.intent?.extras?.get("${"$"}{instance.packageName}.optionalInt") as? Int?) ?: default
}
public val OptionalsActivity.extras: OptionalsActivityParams
Expand Down Expand Up @@ -488,10 +485,8 @@ public class ExerciseProcessorActivityTests : ExerciseProcessorTests() {
requiredValue: ThirdPartyType,
optionalValue: ThirdPartyType? = null,
): Bundle = bundleOf(
"${"$"}{context.packageName}.requiredValue" to
ThirdPartyTypeParceler.writeToMarshalledBytes(requiredValue),
"${"$"}{context.packageName}.optionalValue" to
ThirdPartyTypeParceler.writeToMarshalledBytesOrNull(optionalValue)
"${"$"}{context.packageName}.requiredValue" to ThirdPartyTypeParceler.writeToMarshalledBytes(requiredValue),
"${"$"}{context.packageName}.optionalValue" to ThirdPartyTypeParceler.writeToMarshalledBytesOrNull(optionalValue)
)
public fun bundleForParcelerActivity(
Expand All @@ -500,8 +495,7 @@ public class ExerciseProcessorActivityTests : ExerciseProcessorTests() {
optionalValue: ThirdPartyType? = null,
): Bundle = bundleOf(
"${"$"}{packageName}.requiredValue" to ThirdPartyTypeParceler.writeToMarshalledBytes(requiredValue),
"${"$"}{packageName}.optionalValue" to
ThirdPartyTypeParceler.writeToMarshalledBytesOrNull(optionalValue)
"${"$"}{packageName}.optionalValue" to ThirdPartyTypeParceler.writeToMarshalledBytesOrNull(optionalValue)
)
public class ParcelerActivityIntent : Intent {
Expand Down
3 changes: 1 addition & 2 deletions compile/src/test/kotlin/ExerciseProcessorFragmentTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,7 @@ public class ExerciseProcessorFragmentTests : ExerciseProcessorTests() {
public val optionalInt: Int?
get() = instance.arguments?.get("optionalInt") as Int?
public fun optionalInt(default: Int): Int = (instance.arguments?.get("optionalInt") as? Int?) ?:
default
public fun optionalInt(default: Int): Int = (instance.arguments?.get("optionalInt") as? Int?) ?: default
}
public val OptionalsFragment.args: OptionalsFragmentParams
Expand Down
30 changes: 10 additions & 20 deletions compile/src/test/kotlin/ExerciseProcessorServiceTests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ public class ExerciseProcessorServiceTests : ExerciseProcessorTests() {
private val intent: Intent,
)
public fun NoExtrasService.extras(intent: Intent): NoExtrasServiceParams =
NoExtrasServiceParams(this, intent)
public fun NoExtrasService.extras(intent: Intent): NoExtrasServiceParams = NoExtrasServiceParams(this, intent)
""",
)
}
Expand Down Expand Up @@ -116,8 +115,7 @@ public class ExerciseProcessorServiceTests : ExerciseProcessorTests() {
get() = intent.extras?.get("${"$"}{instance.packageName}.fromSuperclass") as Int
}
public fun SuperclassService.extras(intent: Intent): SuperclassServiceParams =
SuperclassServiceParams(this, intent)
public fun SuperclassService.extras(intent: Intent): SuperclassServiceParams = SuperclassServiceParams(this, intent)
""",
)

Expand Down Expand Up @@ -190,8 +188,7 @@ public class ExerciseProcessorServiceTests : ExerciseProcessorTests() {
get() = intent.extras?.get("${"$"}{instance.packageName}.fromSubclass") as String
}
public fun SubclassService.extras(intent: Intent): SubclassServiceParams =
SubclassServiceParams(this, intent)
public fun SubclassService.extras(intent: Intent): SubclassServiceParams = SubclassServiceParams(this, intent)
""",
)
}
Expand Down Expand Up @@ -310,8 +307,7 @@ public class ExerciseProcessorServiceTests : ExerciseProcessorTests() {
"${"$"}{context.packageName}.optionalInt" to optionalInt
)
public fun bundleForOptionalsService(packageName: String, optionalInt: Int? = null): Bundle =
bundleOf(
public fun bundleForOptionalsService(packageName: String, optionalInt: Int? = null): Bundle = bundleOf(
"${"$"}{packageName}.optionalInt" to optionalInt
)
Expand Down Expand Up @@ -340,12 +336,10 @@ public class ExerciseProcessorServiceTests : ExerciseProcessorTests() {
public val optionalInt: Int?
get() = intent.extras?.get("${"$"}{instance.packageName}.optionalInt") as Int?
public fun optionalInt(default: Int): Int =
(intent.extras?.get("${"$"}{instance.packageName}.optionalInt") as? Int?) ?: default
public fun optionalInt(default: Int): Int = (intent.extras?.get("${"$"}{instance.packageName}.optionalInt") as? Int?) ?: default
}
public fun OptionalsService.extras(intent: Intent): OptionalsServiceParams =
OptionalsServiceParams(this, intent)
public fun OptionalsService.extras(intent: Intent): OptionalsServiceParams = OptionalsServiceParams(this, intent)
""",
)
}
Expand Down Expand Up @@ -408,10 +402,8 @@ public class ExerciseProcessorServiceTests : ExerciseProcessorTests() {
requiredValue: ThirdPartyType,
optionalValue: ThirdPartyType? = null,
): Bundle = bundleOf(
"${"$"}{context.packageName}.requiredValue" to
ThirdPartyTypeParceler.writeToMarshalledBytes(requiredValue),
"${"$"}{context.packageName}.optionalValue" to
ThirdPartyTypeParceler.writeToMarshalledBytesOrNull(optionalValue)
"${"$"}{context.packageName}.requiredValue" to ThirdPartyTypeParceler.writeToMarshalledBytes(requiredValue),
"${"$"}{context.packageName}.optionalValue" to ThirdPartyTypeParceler.writeToMarshalledBytesOrNull(optionalValue)
)
public fun bundleForParcelerService(
Expand All @@ -420,8 +412,7 @@ public class ExerciseProcessorServiceTests : ExerciseProcessorTests() {
optionalValue: ThirdPartyType? = null,
): Bundle = bundleOf(
"${"$"}{packageName}.requiredValue" to ThirdPartyTypeParceler.writeToMarshalledBytes(requiredValue),
"${"$"}{packageName}.optionalValue" to
ThirdPartyTypeParceler.writeToMarshalledBytesOrNull(optionalValue)
"${"$"}{packageName}.optionalValue" to ThirdPartyTypeParceler.writeToMarshalledBytesOrNull(optionalValue)
)
public class ParcelerServiceIntent : Intent {
Expand Down Expand Up @@ -474,8 +465,7 @@ public class ExerciseProcessorServiceTests : ExerciseProcessorTests() {
}
}
public fun ParcelerService.extras(intent: Intent): ParcelerServiceParams =
ParcelerServiceParams(this, intent)
public fun ParcelerService.extras(intent: Intent): ParcelerServiceParams = ParcelerServiceParams(this, intent)
""",
)
}
Expand Down

0 comments on commit 50af3d7

Please sign in to comment.