Skip to content

Commit

Permalink
Fix tests to use current version of openrndr (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vechro authored Jan 7, 2024
1 parent ad501eb commit 2e79b21
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 13 deletions.
1 change: 0 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ tasks {
"idea.home.path" to (System.getenv("INTELLIJ_SOURCES") ?: defaultIntellijSourcesPath),
"version_used_for.openrndr" to libs.versions.openrndr.get(),
"version_used_for.orx" to libs.versions.orx.get(),
"version_used_for.kotlin" to libs.versions.kotlin.get()
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,8 @@ abstract class ColorRGBaTestCase : BasePlatformTestCase() {
companion object {
protected val PROJECT_DESCRIPTOR = DefaultLightProjectDescriptor(
{ IdeaTestUtil.getMockJdk17() }, listOf(
// Fixed to 0.4.3-alpha5 because openrndr no longer uses `kotlin.mpp.enableCompatibilityMetadataVariant`
// which breaks dependency resolution for these tests.
"org.openrndr:openrndr-color:0.4.3-alpha5",
"org.openrndr.extra:orx-color:0.4.3-alpha5",
// This isn't getting pulled in as a transitive dependency from orx-color for
// some reason, so we add it manually.
"org.jetbrains.kotlin:kotlin-stdlib-common:${System.getProperty("version_used_for.kotlin")}"
"org.openrndr:openrndr-color-jvm:${System.getProperty("version_used_for.openrndr")}",
"org.openrndr.extra:orx-color-jvm:${System.getProperty("version_used_for.orx")}",
)
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ class ColorRGBaColorProviderTest : ColorRGBaTestCase() {
private fun assertGutterIconColorManual(expected: Color, code: String) {
myFixture.configureByText(KotlinFileType.INSTANCE, code)
val gutterMarks = myFixture.findAllGutters()
assertSize(1, gutterMarks)
val actualColorIcon = gutterMarks[0].icon as? ColorIcon
assertEquals(expected, actualColorIcon?.iconColor)
assertNotEmpty(gutterMarks)
val iconGutterMark = gutterMarks.first { it.icon is ColorIcon }
val actualColorIcon = iconGutterMark.icon as ColorIcon
assertEquals(expected, actualColorIcon.iconColor)
}

/**
Expand All @@ -39,9 +40,10 @@ class ColorRGBaColorProviderTest : ColorRGBaTestCase() {
) {
myFixture.configureByText(KotlinFileType.INSTANCE, code)
val gutterMarks = myFixture.findAllGutters()
assertSize(1, gutterMarks)
assertNotEmpty(gutterMarks)
val iconGutterMark = gutterMarks.first { it.icon is ColorsIcon }
val actualColorsIcon = iconGutterMark.icon as ColorsIcon
val expectedColorsIcon = ColorsIcon(12, *expected.reversedArray())
val actualColorsIcon = gutterMarks[0].icon as? ColorsIcon
assertEquals(expectedColorsIcon, actualColorsIcon)
}

Expand Down

0 comments on commit 2e79b21

Please sign in to comment.