[Spec tests] Add tests for character-literals
This commit is contained in:
+23
@@ -0,0 +1,23 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
/*
|
||||
* KOTLIN CODEGEN BOX SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SPEC VERSION: 0.1-218
|
||||
* PLACE: expressions, constant-literals, character-literals -> paragraph 4 -> sentence 2
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: character literal codepoint is equal to the unicode symbol codes
|
||||
*/
|
||||
|
||||
fun box(): String {
|
||||
val a = '\u0000'
|
||||
val c = ' ' //u+0020
|
||||
val cMax = '' //u+ffff
|
||||
val aMax = '\uffff'
|
||||
if (a.toShort() == 0x0000.toShort()
|
||||
&& c.toShort() == 0x0020.toShort()
|
||||
&& cMax.toShort() == 0xffff.toShort()
|
||||
&& aMax.toShort() == 0xffff.toShort())
|
||||
return "OK"
|
||||
return "NOK"
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"4": {
|
||||
"pos": {
|
||||
"2": [
|
||||
{
|
||||
"specVersion": "0.1-218",
|
||||
"casesNumber": 0,
|
||||
"description": "character literal codepoint is equal to the unicode symbol codes",
|
||||
"unexpectedBehaviour": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user