[Spec tests] Add tests for character-literals

This commit is contained in:
anastasiia.spaseeva
2019-12-12 18:57:32 +03:00
parent 8187405dbd
commit 3aa3f0c50c
10 changed files with 3534 additions and 0 deletions
@@ -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"
}
@@ -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
}
]
}
}
}