File tree 1 file changed +16
-3
lines changed
kotlin-native/backend.native/tests/runtime/text
1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -7,9 +7,6 @@ package runtime.text.chars0
7
7
8
8
import kotlin.test.*
9
9
10
- fun assertTrue (v : Boolean ) = if (! v) throw AssertionError () else Unit
11
- fun assertFalse (v : Boolean ) = if (v) throw AssertionError () else Unit
12
- fun assertEquals (a : Int , b : Int ) { if (a != b) throw AssertionError () }
13
10
14
11
fun testIsSupplementaryCodePoint () {
15
12
assertFalse(Char .isSupplementaryCodePoint(- 1 ))
@@ -112,11 +109,27 @@ fun testCategory() {
112
109
} catch (e: IllegalArgumentException ) {}
113
110
}
114
111
112
+ fun testIsHighSurrogate () {
113
+ assertTrue(' \uD800 ' .isHighSurrogate())
114
+ assertTrue(' \uDBFF ' .isHighSurrogate())
115
+ assertFalse(' \uDC00 ' .isHighSurrogate())
116
+ assertFalse(' \uDFFF ' .isHighSurrogate())
117
+ }
118
+
119
+ fun testIsLowSurrogate () {
120
+ assertFalse(' \uD800 ' .isLowSurrogate())
121
+ assertFalse(' \uDBFF ' .isLowSurrogate())
122
+ assertTrue(' \uDC00 ' .isLowSurrogate())
123
+ assertTrue(' \uDFFF ' .isLowSurrogate())
124
+ }
125
+
115
126
@Test fun runTest () {
116
127
testIsSurrogatePair()
117
128
testToChars()
118
129
testToCodePoint()
119
130
testIsSupplementaryCodePoint()
120
131
testCase()
121
132
testCategory()
133
+ testIsHighSurrogate()
134
+ testIsLowSurrogate()
122
135
}
You can’t perform that action at this time.
0 commit comments