Skip to content

Commit ec6c9a1

Browse files
committed
Remove PlatformComparisonTest
1 parent 3d5df93 commit ec6c9a1

File tree

3 files changed

+31
-97
lines changed

3 files changed

+31
-97
lines changed

build.gradle.kts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ kotlin {
2828
compilations.all {
2929
kotlinOptions.jvmTarget = "1.8"
3030
}
31-
testRuns["test"].executionTask.configure {
32-
useJUnitPlatform()
33-
}
3431
}
3532

3633
linuxArm64()
@@ -67,10 +64,6 @@ kotlin {
6764
val commonImplementation by creating {
6865
dependsOn(commonMain)
6966
}
70-
71-
val jvmTest by getting {
72-
dependsOn(commonImplementation)
73-
}
7467
}
7568

7669
targets.onEach {

src/commonTest/kotlin/StringExtensionsTest.kt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package de.cketti.codepoints
22

33
import kotlin.test.assertEquals
44
import kotlin.test.Test
5+
import kotlin.test.assertFailsWith
56

67
class StringExtensionsTest {
78
@Test
@@ -120,4 +121,34 @@ class StringExtensionsTest {
120121
assertEquals(0, "\uD83E\uDD95\uD83E\uDD96".offsetByCodePoints(index = 3, codePointOffset = -2))
121122
assertEquals(0, "\uD83E\uDD95\uD83E\uDD96".offsetByCodePoints(index = 1, codePointOffset = -1))
122123
}
124+
125+
@Test
126+
fun offsetByCodePoints_with_invalid_index() {
127+
assertFailsWith<IndexOutOfBoundsException> {
128+
"a".offsetByCodePoints(index = -1, codePointOffset = 0)
129+
}
130+
131+
assertFailsWith<IndexOutOfBoundsException> {
132+
"a".offsetByCodePoints(index = 2, codePointOffset = 0)
133+
}
134+
}
135+
136+
@Test
137+
fun offsetByCodePoints_with_invalid_codePointOffset() {
138+
assertFailsWith<IndexOutOfBoundsException> {
139+
"a".offsetByCodePoints(index = 0, codePointOffset = 2)
140+
}
141+
142+
assertFailsWith<IndexOutOfBoundsException> {
143+
"a".offsetByCodePoints(index = 1, codePointOffset = -2)
144+
}
145+
146+
assertFailsWith<IndexOutOfBoundsException> {
147+
"\uD83E\uDD95".offsetByCodePoints(index = 0, codePointOffset = 2)
148+
}
149+
150+
assertFailsWith<IndexOutOfBoundsException> {
151+
"\uD83E\uDD95".offsetByCodePoints(index = 2, codePointOffset = -2)
152+
}
153+
}
123154
}

src/jvmTest/kotlin/PlatformComparisonTest.kt

Lines changed: 0 additions & 90 deletions
This file was deleted.

0 commit comments

Comments
 (0)