Reorganize spec tests infrastructure code
- Add the tests mute system for the diagnostic tests - Move the code for the test info parsing to the separate package `parsers` - Unification of the `linked` and `not linked` spec tests - Package structure is refactored - Change the multiline comment format with a test information - Actualize `PrintSpecTestsStatistic` - Other different code improvements
This commit is contained in:
+10
-7
@@ -1,12 +1,15 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTIONS: constant-literals, integer-literals, binary-integer-literals
|
||||
PARAGRAPH: 1
|
||||
SENTENCE: [1] A sequence of binary digit symbols (0 or 1) prefixed by 0b or 0B is a binary integer literal.
|
||||
NUMBER: 1
|
||||
DESCRIPTION: Binary integer literals with the prefix only.
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SECTIONS: constant-literals, integer-literals, binary-integer-literals
|
||||
* PARAGRAPH: 1
|
||||
* SENTENCE: [1] A sequence of binary digit symbols (0 or 1) prefixed by 0b or 0B is a binary integer literal.
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: Binary integer literals with the prefix only.
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
val value_1 = <!INT_LITERAL_OUT_OF_RANGE!>0b<!>
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
val value_2 = <!INT_LITERAL_OUT_OF_RANGE!>0B<!>
|
||||
|
||||
+14
-7
@@ -1,14 +1,21 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTIONS: constant-literals, integer-literals, binary-integer-literals
|
||||
PARAGRAPH: 1
|
||||
SENTENCE: [2] Digits may be separated by an underscore symbol, but no underscore can be placed before the first digit or after the last one.
|
||||
NUMBER: 1
|
||||
DESCRIPTION: Binary integer literals with an underscore after the prefix.
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SECTIONS: constant-literals, integer-literals, binary-integer-literals
|
||||
* PARAGRAPH: 1
|
||||
* SENTENCE: [2] Digits may be separated by an underscore symbol, but no underscore can be placed before the first digit or after the last one.
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: Binary integer literals with an underscore after the prefix.
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
val value_1 = <!ILLEGAL_UNDERSCORE!>0b_1110100000<!>
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
val value_2 = <!ILLEGAL_UNDERSCORE!>0B_______11010000<!>
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
val value_3 = <!ILLEGAL_UNDERSCORE!>0B_1_1_0_1_0_0_0_0<!>
|
||||
|
||||
// TESTCASE NUMBER: 4
|
||||
val value_4 = <!ILLEGAL_UNDERSCORE, INT_LITERAL_OUT_OF_RANGE!>0b_<!>
|
||||
|
||||
+39
-18
@@ -1,21 +1,42 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTIONS: constant-literals, integer-literals, binary-integer-literals
|
||||
PARAGRAPH: 1
|
||||
SENTENCE: [2] Digits may be separated by an underscore symbol, but no underscore can be placed before the first digit or after the last one.
|
||||
NUMBER: 2
|
||||
DESCRIPTION: Binary integer literals with an underscore in the first position (it's considered as identifiers).
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SECTIONS: constant-literals, integer-literals, binary-integer-literals
|
||||
* PARAGRAPH: 1
|
||||
* SENTENCE: [2] Digits may be separated by an underscore symbol, but no underscore can be placed before the first digit or after the last one.
|
||||
* NUMBER: 2
|
||||
* DESCRIPTION: Binary integer literals with an underscore in the first position (it's considered as identifiers).
|
||||
*/
|
||||
|
||||
val value_0 = <!UNRESOLVED_REFERENCE!>_____0b0_1_1_1_0_1<!>
|
||||
val value_1 = <!UNRESOLVED_REFERENCE!>_0B1_______1_______1_______0<!>
|
||||
val value_2 = <!UNRESOLVED_REFERENCE!>_0_0B1_0_1_1_1_0_1_1<!>
|
||||
val value_3 = <!UNRESOLVED_REFERENCE!>_0B000000000<!>
|
||||
val value_4 = <!UNRESOLVED_REFERENCE!>_0000000000b<!>
|
||||
val value_5 = <!UNRESOLVED_REFERENCE!>_0_1b<!>
|
||||
val value_6 = <!UNRESOLVED_REFERENCE!>____________0b<!>
|
||||
val value_7 = <!UNRESOLVED_REFERENCE!>_0_b_0<!>
|
||||
val value_8 = <!UNRESOLVED_REFERENCE!>_b_0<!>
|
||||
val value_9 = <!UNRESOLVED_REFERENCE!>_b<!>
|
||||
val value_10 = <!UNRESOLVED_REFERENCE!>_b_<!>
|
||||
// TESTCASE NUMBER: 1
|
||||
val value_1 = <!UNRESOLVED_REFERENCE!>_____0b0_1_1_1_0_1<!>
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
val value_2 = <!UNRESOLVED_REFERENCE!>_0B1_______1_______1_______0<!>
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
val value_3 = <!UNRESOLVED_REFERENCE!>_0_0B1_0_1_1_1_0_1_1<!>
|
||||
|
||||
// TESTCASE NUMBER: 4
|
||||
val value_4 = <!UNRESOLVED_REFERENCE!>_0B000000000<!>
|
||||
|
||||
// TESTCASE NUMBER: 5
|
||||
val value_5 = <!UNRESOLVED_REFERENCE!>_0000000000b<!>
|
||||
|
||||
// TESTCASE NUMBER: 6
|
||||
val value_6 = <!UNRESOLVED_REFERENCE!>_0_1b<!>
|
||||
|
||||
// TESTCASE NUMBER: 7
|
||||
val value_7 = <!UNRESOLVED_REFERENCE!>____________0b<!>
|
||||
|
||||
// TESTCASE NUMBER: 8
|
||||
val value_8 = <!UNRESOLVED_REFERENCE!>_0_b_0<!>
|
||||
|
||||
// TESTCASE NUMBER: 9
|
||||
val value_9 = <!UNRESOLVED_REFERENCE!>_b_0<!>
|
||||
|
||||
// TESTCASE NUMBER: 10
|
||||
val value_10 = <!UNRESOLVED_REFERENCE!>_b<!>
|
||||
|
||||
// TESTCASE NUMBER: 12
|
||||
val value_12 = <!UNRESOLVED_REFERENCE!>_b_<!>
|
||||
|
||||
+11
-11
@@ -1,13 +1,13 @@
|
||||
package
|
||||
|
||||
public val value_0: [ERROR : Type for _____0b0_1_1_1_0_1]
|
||||
public val value_1: [ERROR : Type for _0B1_______1_______1_______0]
|
||||
public val value_10: [ERROR : Type for _b_]
|
||||
public val value_2: [ERROR : Type for _0_0B1_0_1_1_1_0_1_1]
|
||||
public val value_3: [ERROR : Type for _0B000000000]
|
||||
public val value_4: [ERROR : Type for _0000000000b]
|
||||
public val value_5: [ERROR : Type for _0_1b]
|
||||
public val value_6: [ERROR : Type for ____________0b]
|
||||
public val value_7: [ERROR : Type for _0_b_0]
|
||||
public val value_8: [ERROR : Type for _b_0]
|
||||
public val value_9: [ERROR : Type for _b]
|
||||
public val value_1: [ERROR : Type for _____0b0_1_1_1_0_1]
|
||||
public val value_10: [ERROR : Type for _b]
|
||||
public val value_12: [ERROR : Type for _b_]
|
||||
public val value_2: [ERROR : Type for _0B1_______1_______1_______0]
|
||||
public val value_3: [ERROR : Type for _0_0B1_0_1_1_1_0_1_1]
|
||||
public val value_4: [ERROR : Type for _0B000000000]
|
||||
public val value_5: [ERROR : Type for _0000000000b]
|
||||
public val value_6: [ERROR : Type for _0_1b]
|
||||
public val value_7: [ERROR : Type for ____________0b]
|
||||
public val value_8: [ERROR : Type for _0_b_0]
|
||||
public val value_9: [ERROR : Type for _b_0]
|
||||
|
||||
+20
-7
@@ -1,17 +1,30 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTIONS: constant-literals, integer-literals, binary-integer-literals
|
||||
PARAGRAPH: 1
|
||||
SENTENCE: [2] Digits may be separated by an underscore symbol, but no underscore can be placed before the first digit or after the last one.
|
||||
NUMBER: 3
|
||||
DESCRIPTION: Binary integer literals with an underscore in the last position.
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SECTIONS: constant-literals, integer-literals, binary-integer-literals
|
||||
* PARAGRAPH: 1
|
||||
* SENTENCE: [2] Digits may be separated by an underscore symbol, but no underscore can be placed before the first digit or after the last one.
|
||||
* NUMBER: 3
|
||||
* DESCRIPTION: Binary integer literals with an underscore in the last position.
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
val value_1 = <!ILLEGAL_UNDERSCORE!>0b0_1_1_0_1_1_____<!>
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
val value_2 = <!ILLEGAL_UNDERSCORE!>0B1_______1_______0_______1_<!>
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
val value_3 = <!ILLEGAL_UNDERSCORE!>0B000000000_<!>
|
||||
|
||||
// TESTCASE NUMBER: 4
|
||||
val value_4 = <!ILLEGAL_UNDERSCORE, INT_LITERAL_OUT_OF_RANGE!>0b_<!>
|
||||
|
||||
// TESTCASE NUMBER: 5
|
||||
val value_5 = <!ILLEGAL_UNDERSCORE, INT_LITERAL_OUT_OF_RANGE!>0B______________<!>
|
||||
|
||||
// TESTCASE NUMBER: 6
|
||||
val value_6 = <!ILLEGAL_UNDERSCORE!>0B0_<!>
|
||||
|
||||
// TESTCASE NUMBER: 7
|
||||
val value_7 = <!ILLEGAL_UNDERSCORE!>0B10_<!>
|
||||
|
||||
+16
-7
@@ -1,15 +1,24 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTIONS: constant-literals, integer-literals, decimal-integer-literals
|
||||
PARAGRAPH: 1
|
||||
SENTENCE: [2] Digits may be separated by an underscore symbol, but no underscore can be placed before the first digit or after the last one.
|
||||
NUMBER: 1
|
||||
DESCRIPTION: Integer literals with an underscore in the last position.
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SECTIONS: constant-literals, integer-literals, decimal-integer-literals
|
||||
* PARAGRAPH: 1
|
||||
* SENTENCE: [2] Digits may be separated by an underscore symbol, but no underscore can be placed before the first digit or after the last one.
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: Integer literals with an underscore in the last position.
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
val value_1 = <!ILLEGAL_UNDERSCORE!>1_<!>
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
val value_2 = <!ILLEGAL_UNDERSCORE!>1_00000000000000000_<!>
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
val value_3 = <!ILLEGAL_UNDERSCORE!>1_____________<!>
|
||||
|
||||
// TESTCASE NUMBER: 4
|
||||
val value_4 = <!ILLEGAL_UNDERSCORE!>9____________0_<!>
|
||||
|
||||
// TESTCASE NUMBER: 5
|
||||
val value_5 = <!ILLEGAL_UNDERSCORE!>1_______________________________________________________________________________________________________________________________________________________<!>
|
||||
|
||||
+22
-7
@@ -1,18 +1,33 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTIONS: constant-literals, integer-literals, decimal-integer-literals
|
||||
PARAGRAPH: 1
|
||||
SENTENCE: [2] Digits may be separated by an underscore symbol, but no underscore can be placed before the first digit or after the last one.
|
||||
NUMBER: 2
|
||||
DESCRIPTION: Integer literals with an underscore in the first position (it's considered as identifiers).
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SECTIONS: constant-literals, integer-literals, decimal-integer-literals
|
||||
* PARAGRAPH: 1
|
||||
* SENTENCE: [2] Digits may be separated by an underscore symbol, but no underscore can be placed before the first digit or after the last one.
|
||||
* NUMBER: 2
|
||||
* DESCRIPTION: Integer literals with an underscore in the first position (it's considered as identifiers).
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
val value_1 = <!UNRESOLVED_REFERENCE!>_5678_90<!>
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
val value_2 = <!UNRESOLVED_REFERENCE!>_2_3_4_5_6_7_8_9_<!>
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
val value_3 = <!UNRESOLVED_REFERENCE!>_____________0000<!>
|
||||
|
||||
// TESTCASE NUMBER: 4
|
||||
val value_4 = <!UNRESOLVED_REFERENCE!>_______________________________________________________________________________________________________________________________________________________0<!>
|
||||
|
||||
// TESTCASE NUMBER: 5
|
||||
val value_5 = <!UNRESOLVED_REFERENCE!>____________________________________________________<!>
|
||||
|
||||
// TESTCASE NUMBER: 6
|
||||
val value_6 = <!UNRESOLVED_REFERENCE!>_<!>
|
||||
|
||||
// TESTCASE NUMBER: 7
|
||||
val value_7 = <!UNRESOLVED_REFERENCE!>_0_<!>
|
||||
|
||||
// TESTCASE NUMBER: 8
|
||||
val value_8 = <!UNRESOLVED_REFERENCE!>_9_<!>
|
||||
|
||||
+10
-7
@@ -1,12 +1,15 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTIONS: constant-literals, integer-literals, hexadecimal-integer-literals
|
||||
PARAGRAPH: 1
|
||||
SENTENCE: [1] A sequence of hexadecimal digit symbols (0 through 9, a through f, A through F) prefixed by 0x or 0X is a hexadecimal integer literal.
|
||||
NUMBER: 1
|
||||
DESCRIPTION: Hexadecimal integer literals with the prefix only.
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SECTIONS: constant-literals, integer-literals, hexadecimal-integer-literals
|
||||
* PARAGRAPH: 1
|
||||
* SENTENCE: [1] A sequence of hexadecimal digit symbols (0 through 9, a through f, A through F) prefixed by 0x or 0X is a hexadecimal integer literal.
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: Hexadecimal integer literals with the prefix only.
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
val value_1 = <!INT_LITERAL_OUT_OF_RANGE!>0x<!>
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
val value_2 = <!INT_LITERAL_OUT_OF_RANGE!>0X<!>
|
||||
|
||||
+14
-7
@@ -1,14 +1,21 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTIONS: constant-literals, integer-literals, hexadecimal-integer-literals
|
||||
PARAGRAPH: 1
|
||||
SENTENCE: [2] Digits may be separated by an underscore symbol, but no underscore can be placed before the first digit or after the last one.
|
||||
NUMBER: 1
|
||||
DESCRIPTION: Hexadecimal integer literals with an underscore after the prefix.
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SECTIONS: constant-literals, integer-literals, hexadecimal-integer-literals
|
||||
* PARAGRAPH: 1
|
||||
* SENTENCE: [2] Digits may be separated by an underscore symbol, but no underscore can be placed before the first digit or after the last one.
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: Hexadecimal integer literals with an underscore after the prefix.
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
val value_1 = <!ILLEGAL_UNDERSCORE!>0x_1234567890<!>
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
val value_2 = <!ILLEGAL_UNDERSCORE!>0X_______23456789<!>
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
val value_3 = <!ILLEGAL_UNDERSCORE!>0X_2_3_4_5_6_7_8_9<!>
|
||||
|
||||
// TESTCASE NUMBER: 4
|
||||
val value_4 = <!ILLEGAL_UNDERSCORE, INT_LITERAL_OUT_OF_RANGE!>0x_<!>
|
||||
|
||||
+28
-7
@@ -1,21 +1,42 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTIONS: constant-literals, integer-literals, hexadecimal-integer-literals
|
||||
PARAGRAPH: 1
|
||||
SENTENCE: [2] Digits may be separated by an underscore symbol, but no underscore can be placed before the first digit or after the last one.
|
||||
NUMBER: 2
|
||||
DESCRIPTION: Hexadecimal integer literals with an underscore in the first position (it's considered as identifiers).
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SECTIONS: constant-literals, integer-literals, hexadecimal-integer-literals
|
||||
* PARAGRAPH: 1
|
||||
* SENTENCE: [2] Digits may be separated by an underscore symbol, but no underscore can be placed before the first digit or after the last one.
|
||||
* NUMBER: 2
|
||||
* DESCRIPTION: Hexadecimal integer literals with an underscore in the first position (it's considered as identifiers).
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
val value_1 = <!UNRESOLVED_REFERENCE!>_____0x3_4_5_6_7_8<!>
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
val value_2 = <!UNRESOLVED_REFERENCE!>_0X4_______5_______6_______7<!>
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
val value_3 = <!UNRESOLVED_REFERENCE!>_0_0X4_3_4_5_6_7_8_9<!>
|
||||
|
||||
// TESTCASE NUMBER: 4
|
||||
val value_4 = <!UNRESOLVED_REFERENCE!>_0X000000000<!>
|
||||
|
||||
// TESTCASE NUMBER: 5
|
||||
val value_5 = <!UNRESOLVED_REFERENCE!>_0000000000x<!>
|
||||
|
||||
// TESTCASE NUMBER: 6
|
||||
val value_6 = <!UNRESOLVED_REFERENCE!>_0_9x<!>
|
||||
|
||||
// TESTCASE NUMBER: 7
|
||||
val value_7 = <!UNRESOLVED_REFERENCE!>____________0x<!>
|
||||
|
||||
// TESTCASE NUMBER: 8
|
||||
val value_8 = <!UNRESOLVED_REFERENCE!>_0_x_0<!>
|
||||
|
||||
// TESTCASE NUMBER: 9
|
||||
val value_9 = <!UNRESOLVED_REFERENCE!>_x_0<!>
|
||||
|
||||
// TESTCASE NUMBER: 10
|
||||
val value_10 = <!UNRESOLVED_REFERENCE!>_x<!>
|
||||
|
||||
// TESTCASE NUMBER: 11
|
||||
val value_11 = <!UNRESOLVED_REFERENCE!>_x_<!>
|
||||
|
||||
+20
-7
@@ -1,17 +1,30 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTIONS: constant-literals, integer-literals, hexadecimal-integer-literals
|
||||
PARAGRAPH: 1
|
||||
SENTENCE: [2] A sequence of hexadecimal digit symbols (0 through 9, a through f, A through F) prefixed by 0x or 0X is a hexadecimal integer literal.
|
||||
NUMBER: 3
|
||||
DESCRIPTION: Hexadecimal integer literals with an underscore in the last position.
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SECTIONS: constant-literals, integer-literals, hexadecimal-integer-literals
|
||||
* PARAGRAPH: 1
|
||||
* SENTENCE: [2] A sequence of hexadecimal digit symbols (0 through 9, a through f, A through F) prefixed by 0x or 0X is a hexadecimal integer literal.
|
||||
* NUMBER: 3
|
||||
* DESCRIPTION: Hexadecimal integer literals with an underscore in the last position.
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
val value_1 = <!ILLEGAL_UNDERSCORE!>0x3_4_5_6_7_8_____<!>
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
val value_2 = <!ILLEGAL_UNDERSCORE!>0X4_______5_______6_______7_<!>
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
val value_3 = <!ILLEGAL_UNDERSCORE!>0X000000000_<!>
|
||||
|
||||
// TESTCASE NUMBER: 5
|
||||
val value_5 = <!ILLEGAL_UNDERSCORE, INT_LITERAL_OUT_OF_RANGE!>0x_<!>
|
||||
|
||||
// TESTCASE NUMBER: 6
|
||||
val value_6 = <!ILLEGAL_UNDERSCORE, INT_LITERAL_OUT_OF_RANGE!>0X______________<!>
|
||||
|
||||
// TESTCASE NUMBER: 7
|
||||
val value_7 = <!ILLEGAL_UNDERSCORE!>0X0_<!>
|
||||
|
||||
// TESTCASE NUMBER: 8
|
||||
val value_8 = <!ILLEGAL_UNDERSCORE!>0X10_<!>
|
||||
|
||||
+21
-7
@@ -1,19 +1,33 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTIONS: constant-literals, integer-literals, long-integer-literals
|
||||
PARAGRAPH: 1
|
||||
SENTENCE: [1] Any of the decimal, hexadecimal or binary literals may be suffixed by the long literal mark (symbol L).
|
||||
NUMBER: 1
|
||||
DESCRIPTION: Binary and hexadecimal integer literals with a long literal mark only.
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SECTIONS: constant-literals, integer-literals, long-integer-literals
|
||||
* PARAGRAPH: 1
|
||||
* SENTENCE: [1] Any of the decimal, hexadecimal or binary literals may be suffixed by the long literal mark (symbol L).
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: Binary and hexadecimal integer literals with a long literal mark only.
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
val value_1 = <!INT_LITERAL_OUT_OF_RANGE!>0bl<!>
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
val value_2 = <!INT_LITERAL_OUT_OF_RANGE!>0BL<!>
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
val value_3 = <!INT_LITERAL_OUT_OF_RANGE!>0Xl<!>
|
||||
|
||||
// TESTCASE NUMBER: 4
|
||||
val value_4 = <!INT_LITERAL_OUT_OF_RANGE!>0xL<!>
|
||||
|
||||
// TESTCASE NUMBER: 5
|
||||
val value_5 = <!ILLEGAL_UNDERSCORE, INT_LITERAL_OUT_OF_RANGE!>0b_l<!>
|
||||
|
||||
// TESTCASE NUMBER: 6
|
||||
val value_6 = <!ILLEGAL_UNDERSCORE, INT_LITERAL_OUT_OF_RANGE!>0B_L<!>
|
||||
|
||||
// TESTCASE NUMBER: 7
|
||||
val value_7 = <!ILLEGAL_UNDERSCORE, INT_LITERAL_OUT_OF_RANGE!>0X____l<!>
|
||||
|
||||
// TESTCASE NUMBER: 8
|
||||
val value_8 = <!ILLEGAL_UNDERSCORE, INT_LITERAL_OUT_OF_RANGE!>0x_L<!>
|
||||
|
||||
+14
-7
@@ -1,14 +1,21 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTIONS: constant-literals, integer-literals, long-integer-literals
|
||||
PARAGRAPH: 1
|
||||
SENTENCE: [1] Any of the decimal, hexadecimal or binary literals may be suffixed by the long literal mark (symbol L).
|
||||
NUMBER: 2
|
||||
DESCRIPTION: Various integer literals with a not allowed underscore before the long literal mark.
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SECTIONS: constant-literals, integer-literals, long-integer-literals
|
||||
* PARAGRAPH: 1
|
||||
* SENTENCE: [1] Any of the decimal, hexadecimal or binary literals may be suffixed by the long literal mark (symbol L).
|
||||
* NUMBER: 2
|
||||
* DESCRIPTION: Various integer literals with a not allowed underscore before the long literal mark.
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
val value_1 = <!ILLEGAL_UNDERSCORE!>0b0_<!WRONG_LONG_SUFFIX!>l<!><!>
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
val value_2 = <!ILLEGAL_UNDERSCORE, INT_LITERAL_OUT_OF_RANGE!>0B12_L<!>
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
val value_3 = <!ILLEGAL_UNDERSCORE!>0X234_<!WRONG_LONG_SUFFIX!>l<!><!>
|
||||
|
||||
// TESTCASE NUMBER: 4
|
||||
val value_4 = <!ILLEGAL_UNDERSCORE!>0x3567_L<!>
|
||||
|
||||
+14
-7
@@ -1,14 +1,21 @@
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTIONS: constant-literals, integer-literals, long-integer-literals
|
||||
PARAGRAPH: 1
|
||||
SENTENCE: [1] Any of the decimal, hexadecimal or binary literals may be suffixed by the long literal mark (symbol L).
|
||||
NUMBER: 3
|
||||
DESCRIPTION: Various integer literals with not allowed long literal mark in lower case.
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SECTIONS: constant-literals, integer-literals, long-integer-literals
|
||||
* PARAGRAPH: 1
|
||||
* SENTENCE: [1] Any of the decimal, hexadecimal or binary literals may be suffixed by the long literal mark (symbol L).
|
||||
* NUMBER: 3
|
||||
* DESCRIPTION: Various integer literals with not allowed long literal mark in lower case.
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
val value_1 = 0<!WRONG_LONG_SUFFIX!>l<!>
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
val value_2 = 1000000000000000<!WRONG_LONG_SUFFIX!>l<!>
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
val value_3 = 0X0<!WRONG_LONG_SUFFIX!>l<!>
|
||||
|
||||
// TESTCASE NUMBER: 4
|
||||
val value_4 = 0b101<!WRONG_LONG_SUFFIX!>l<!>
|
||||
|
||||
+8
-7
@@ -2,15 +2,16 @@
|
||||
// SKIP_TXT
|
||||
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTIONS: constant-literals, integer-literals, long-integer-literals
|
||||
PARAGRAPH: 1
|
||||
SENTENCE: [2] An integer literal with the long literal mark has type kotlin.Long; an integer literal without it has one of the types kotlin.Int/kotlin.Short/kotlin.Byte (the selected type is dependent on the context), if its value is in range of the corresponding type, or type kotlin.Long otherwise.
|
||||
NUMBER: 1
|
||||
DESCRIPTION: Various integer literals with not allowed long literal mark in lower case (type checking).
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SECTIONS: constant-literals, integer-literals, long-integer-literals
|
||||
* PARAGRAPH: 1
|
||||
* SENTENCE: [2] An integer literal with the long literal mark has type kotlin.Long; an integer literal without it has one of the types kotlin.Int/kotlin.Short/kotlin.Byte (the selected type is dependent on the context), if its value is in range of the corresponding type, or type kotlin.Long otherwise.
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: Various integer literals with not allowed long literal mark in lower case (type checking).
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1() {
|
||||
0<!WRONG_LONG_SUFFIX!>l<!> checkType { _<Long>() }
|
||||
10000000000000<!WRONG_LONG_SUFFIX!>l<!> checkType { _<Long>() }
|
||||
|
||||
+8
-7
@@ -2,15 +2,16 @@
|
||||
// SKIP_TXT
|
||||
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTIONS: constant-literals, integer-literals, long-integer-literals
|
||||
PARAGRAPH: 1
|
||||
SENTENCE: [2] An integer literal with the long literal mark has type kotlin.Long; an integer literal without it has one of the types kotlin.Int/kotlin.Short/kotlin.Byte (the selected type is dependent on the context), if its value is in range of the corresponding type, or type kotlin.Long otherwise.
|
||||
NUMBER: 2
|
||||
DESCRIPTION: Type checking (comparison with invalid types) of various integer literals with long literal mark.
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SECTIONS: constant-literals, integer-literals, long-integer-literals
|
||||
* PARAGRAPH: 1
|
||||
* SENTENCE: [2] An integer literal with the long literal mark has type kotlin.Long; an integer literal without it has one of the types kotlin.Int/kotlin.Short/kotlin.Byte (the selected type is dependent on the context), if its value is in range of the corresponding type, or type kotlin.Long otherwise.
|
||||
* NUMBER: 2
|
||||
* DESCRIPTION: Type checking (comparison with invalid types) of various integer literals with long literal mark.
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1() {
|
||||
0L checkType { <!TYPE_MISMATCH!>_<!><Short>() }
|
||||
1000000L checkType { <!TYPE_MISMATCH!>_<!><Int>() }
|
||||
|
||||
+23
-7
@@ -2,20 +2,24 @@
|
||||
// SKIP_TXT
|
||||
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTIONS: constant-literals, integer-literals, long-integer-literals
|
||||
PARAGRAPH: 1
|
||||
SENTENCE: [2] An integer literal with the long literal mark has type kotlin.Long; an integer literal without it has one of the types kotlin.Int/kotlin.Short/kotlin.Byte (the selected type is dependent on the context), if its value is in range of the corresponding type, or type kotlin.Long otherwise.
|
||||
NUMBER: 3
|
||||
DESCRIPTION: Type checking (comparison with invalid types) of various integer literals.
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SECTIONS: constant-literals, integer-literals, long-integer-literals
|
||||
* PARAGRAPH: 1
|
||||
* SENTENCE: [2] An integer literal with the long literal mark has type kotlin.Long; an integer literal without it has one of the types kotlin.Int/kotlin.Short/kotlin.Byte (the selected type is dependent on the context), if its value is in range of the corresponding type, or type kotlin.Long otherwise.
|
||||
* NUMBER: 3
|
||||
* DESCRIPTION: Type checking (comparison with invalid types) of various integer literals.
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1() {
|
||||
0 checkType { <!TYPE_MISMATCH!>_<!><Byte>() }
|
||||
0 checkType { <!TYPE_MISMATCH!>_<!><Short>() }
|
||||
0 checkType { <!TYPE_MISMATCH!>_<!><Long>() }
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
fun case_2() {
|
||||
127 checkType { <!TYPE_MISMATCH!>_<!><Byte>() }
|
||||
127 checkType { <!TYPE_MISMATCH!>_<!><Short>() }
|
||||
127 checkType { <!TYPE_MISMATCH!>_<!><Long>() }
|
||||
@@ -33,7 +37,10 @@ fun case_1() {
|
||||
-129 checkType { <!TYPE_MISMATCH!>_<!><Byte>() }
|
||||
-129 checkType { <!TYPE_MISMATCH!>_<!><Short>() }
|
||||
-129 checkType { <!TYPE_MISMATCH!>_<!><Long>() }
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
fun case_3() {
|
||||
checkSubtype<Byte>(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>32767<!>)
|
||||
32767 checkType { <!TYPE_MISMATCH!>_<!><Byte>() }
|
||||
32767 checkType { <!TYPE_MISMATCH!>_<!><Short>() }
|
||||
@@ -55,7 +62,10 @@ fun case_1() {
|
||||
-32769 checkType { <!TYPE_MISMATCH!>_<!><Byte>() }
|
||||
-32769 checkType { <!TYPE_MISMATCH!>_<!><Short>() }
|
||||
-32769 checkType { <!TYPE_MISMATCH!>_<!><Long>() }
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 4
|
||||
fun case_4() {
|
||||
checkSubtype<Byte>(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>2147483647<!>)
|
||||
checkSubtype<Short>(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>2147483647<!>)
|
||||
2147483647 checkType { <!TYPE_MISMATCH!>_<!><Byte>() }
|
||||
@@ -81,7 +91,10 @@ fun case_1() {
|
||||
-2147483649 checkType { <!TYPE_MISMATCH!>_<!><Byte>() }
|
||||
-2147483649 checkType { <!TYPE_MISMATCH!>_<!><Short>() }
|
||||
-2147483649 checkType { <!TYPE_MISMATCH!>_<!><Int>() }
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 5
|
||||
fun case_5() {
|
||||
checkSubtype<Byte>(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>9223372036854775807<!>)
|
||||
checkSubtype<Short>(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>9223372036854775807<!>)
|
||||
checkSubtype<Int>(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>9223372036854775807<!>)
|
||||
@@ -95,7 +108,10 @@ fun case_1() {
|
||||
-9223372036854775807 checkType { <!TYPE_MISMATCH!>_<!><Byte>() }
|
||||
-9223372036854775807 checkType { <!TYPE_MISMATCH!>_<!><Short>() }
|
||||
-9223372036854775807 checkType { <!TYPE_MISMATCH!>_<!><Int>() }
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 6
|
||||
fun case_6() {
|
||||
checkSubtype<Byte>(<!TYPE_MISMATCH!>-<!INT_LITERAL_OUT_OF_RANGE!>100000000000000000000000000000000<!><!>)
|
||||
checkSubtype<Short>(<!TYPE_MISMATCH!>-<!INT_LITERAL_OUT_OF_RANGE!>100000000000000000000000000000000<!><!>)
|
||||
checkSubtype<Int>(-<!INT_LITERAL_OUT_OF_RANGE!>100000000000000000000000000000000<!>)
|
||||
|
||||
+11
-7
@@ -2,22 +2,26 @@
|
||||
// SKIP_TXT
|
||||
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTIONS: constant-literals, integer-literals, long-integer-literals
|
||||
PARAGRAPH: 1
|
||||
SENTENCE: [2] An integer literal with the long literal mark has type kotlin.Long; an integer literal without it has one of the types kotlin.Int/kotlin.Short/kotlin.Byte (the selected type is dependent on the context), if its value is in range of the corresponding type, or type kotlin.Long otherwise.
|
||||
NUMBER: 4
|
||||
DESCRIPTION: Type checking (comparison with invalid types) of too a big integers.
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SECTIONS: constant-literals, integer-literals, long-integer-literals
|
||||
* PARAGRAPH: 1
|
||||
* SENTENCE: [2] An integer literal with the long literal mark has type kotlin.Long; an integer literal without it has one of the types kotlin.Int/kotlin.Short/kotlin.Byte (the selected type is dependent on the context), if its value is in range of the corresponding type, or type kotlin.Long otherwise.
|
||||
* NUMBER: 4
|
||||
* DESCRIPTION: Type checking (comparison with invalid types) of too a big integers.
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1() {
|
||||
checkSubtype<Long>(<!TYPE_MISMATCH!>-<!INT_LITERAL_OUT_OF_RANGE!>9223372036854775808L<!><!>)
|
||||
-<!INT_LITERAL_OUT_OF_RANGE!>9223372036854775808L<!> checkType { <!TYPE_MISMATCH!>_<!><Long>() }
|
||||
|
||||
checkSubtype<Long>(<!INT_LITERAL_OUT_OF_RANGE!>9223372036854775808L<!>)
|
||||
<!INT_LITERAL_OUT_OF_RANGE!>9223372036854775808L<!> checkType { <!TYPE_MISMATCH!>_<!><Long>() }
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
fun case_2() {
|
||||
checkSubtype<Long>(<!INT_LITERAL_OUT_OF_RANGE!>100000000000000000000000000000000L<!>)
|
||||
<!INT_LITERAL_OUT_OF_RANGE!>100000000000000000000000000000000L<!> checkType { <!TYPE_MISMATCH!>_<!><Long>() }
|
||||
|
||||
|
||||
+15
-10
@@ -2,31 +2,33 @@
|
||||
// SKIP_TXT
|
||||
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
|
||||
SECTIONS: constant-literals, integer-literals, long-integer-literals
|
||||
PARAGRAPH: 1
|
||||
SENTENCE: [2] An integer literal with the long literal mark has type kotlin.Long; an integer literal without it has one of the types kotlin.Int/kotlin.Short/kotlin.Byte (the selected type is dependent on the context), if its value is in range of the corresponding type, or type kotlin.Long otherwise.
|
||||
NUMBER: 5
|
||||
DESCRIPTION: Check of integer type selection depends on the context (incopatible types).
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
* SECTIONS: constant-literals, integer-literals, long-integer-literals
|
||||
* PARAGRAPH: 1
|
||||
* SENTENCE: [2] An integer literal with the long literal mark has type kotlin.Long; an integer literal without it has one of the types kotlin.Int/kotlin.Short/kotlin.Byte (the selected type is dependent on the context), if its value is in range of the corresponding type, or type kotlin.Long otherwise.
|
||||
* NUMBER: 5
|
||||
* DESCRIPTION: Check of integer type selection depends on the context (incopatible types).
|
||||
*/
|
||||
|
||||
// FILE: functions.kt
|
||||
|
||||
package functions
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun f1(x1: Byte) = x1
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
fun f2(x1: Short) = x1
|
||||
|
||||
// TESTCASE NUMBER: 3, 4
|
||||
fun f3(x1: Int) = x1
|
||||
|
||||
fun f4(x1: Long) = x1
|
||||
|
||||
// FILE: usages.kt
|
||||
// FILE: main.kt
|
||||
|
||||
import functions.*
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1() {
|
||||
f1(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>128<!>)
|
||||
f1(<!TYPE_MISMATCH!>-129<!>)
|
||||
@@ -40,6 +42,7 @@ fun case_1() {
|
||||
f1(<!TYPE_MISMATCH!>-<!INT_LITERAL_OUT_OF_RANGE!>1000000000000000000000000000000000000000000000000<!><!>)
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
fun case_2() {
|
||||
f2(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>32768<!>)
|
||||
f2(<!TYPE_MISMATCH!>-32769<!>)
|
||||
@@ -51,6 +54,7 @@ fun case_2() {
|
||||
f2(<!TYPE_MISMATCH!>-<!INT_LITERAL_OUT_OF_RANGE!>1000000000000000000000000000000000000000000000000<!><!>)
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
fun case_3() {
|
||||
f3(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>9223372036854775807<!>)
|
||||
f3(<!TYPE_MISMATCH!>-9223372036854775807<!>)
|
||||
@@ -58,6 +62,7 @@ fun case_3() {
|
||||
f3(-<!INT_LITERAL_OUT_OF_RANGE!>1000000000000000000000000000000000000000000000000<!>)
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 4
|
||||
fun case_4() {
|
||||
f3(<!INT_LITERAL_OUT_OF_RANGE!>1000000000000000000000000000000000000000000000000<!>)
|
||||
f3(-<!INT_LITERAL_OUT_OF_RANGE!>1000000000000000000000000000000000000000000000000<!>)
|
||||
|
||||
+9
-7
@@ -2,15 +2,16 @@
|
||||
// SKIP_TXT
|
||||
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTIONS: constant-literals, integer-literals, long-integer-literals
|
||||
PARAGRAPH: 1
|
||||
SENTENCE: [2] An integer literal with the long literal mark has type kotlin.Long; an integer literal without it has one of the types kotlin.Int/kotlin.Short/kotlin.Byte (the selected type is dependent on the context), if its value is in range of the corresponding type, or type kotlin.Long otherwise.
|
||||
NUMBER: 1
|
||||
DESCRIPTION: Type checking of various integer literals with long literal mark.
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SECTIONS: constant-literals, integer-literals, long-integer-literals
|
||||
* PARAGRAPH: 1
|
||||
* SENTENCE: [2] An integer literal with the long literal mark has type kotlin.Long; an integer literal without it has one of the types kotlin.Int/kotlin.Short/kotlin.Byte (the selected type is dependent on the context), if its value is in range of the corresponding type, or type kotlin.Long otherwise.
|
||||
* NUMBER: 1
|
||||
* DESCRIPTION: Type checking of various integer literals with long literal mark.
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1() {
|
||||
0L checkType { _<Long>() }
|
||||
10000000000000L checkType { _<Long>() }
|
||||
@@ -20,6 +21,7 @@ fun case_1() {
|
||||
0b0L checkType { _<Long>() }
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
fun case_2() {
|
||||
9223372036854775807L checkType { _<Long>() }
|
||||
-9223372036854775807L checkType { _<Long>() }
|
||||
|
||||
+20
-7
@@ -2,22 +2,26 @@
|
||||
// SKIP_TXT
|
||||
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTIONS: constant-literals, integer-literals, long-integer-literals
|
||||
PARAGRAPH: 1
|
||||
SENTENCE: [2] An integer literal with the long literal mark has type kotlin.Long; an integer literal without it has one of the types kotlin.Int/kotlin.Short/kotlin.Byte (the selected type is dependent on the context), if its value is in range of the corresponding type, or type kotlin.Long otherwise.
|
||||
NUMBER: 2
|
||||
DESCRIPTION: Type checking of decimal integer literals.
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SECTIONS: constant-literals, integer-literals, long-integer-literals
|
||||
* PARAGRAPH: 1
|
||||
* SENTENCE: [2] An integer literal with the long literal mark has type kotlin.Long; an integer literal without it has one of the types kotlin.Int/kotlin.Short/kotlin.Byte (the selected type is dependent on the context), if its value is in range of the corresponding type, or type kotlin.Long otherwise.
|
||||
* NUMBER: 2
|
||||
* DESCRIPTION: Type checking of decimal integer literals.
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1() {
|
||||
0 checkType { _<Int>() }
|
||||
checkSubtype<Int>(0)
|
||||
checkSubtype<Short>(0)
|
||||
checkSubtype<Byte>(0)
|
||||
checkSubtype<Long>(0)
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
fun case_2() {
|
||||
127 checkType { _<Int>() }
|
||||
checkSubtype<Int>(127)
|
||||
checkSubtype<Short>(127)
|
||||
@@ -39,7 +43,10 @@ fun case_1() {
|
||||
checkSubtype<Int>(-129)
|
||||
checkSubtype<Short>(-129)
|
||||
checkSubtype<Long>(-129)
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
fun case_3() {
|
||||
32767 checkType { _<Int>() }
|
||||
checkSubtype<Int>(32767)
|
||||
checkSubtype<Short>(32767)
|
||||
@@ -57,7 +64,10 @@ fun case_1() {
|
||||
-32769 checkType { _<Int>() }
|
||||
checkSubtype<Int>(-32769)
|
||||
checkSubtype<Long>(-32769)
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 4
|
||||
fun case_4() {
|
||||
2147483647 checkType { _<Int>() }
|
||||
checkSubtype<Int>(2147483647)
|
||||
checkSubtype<Long>(2147483647)
|
||||
@@ -71,7 +81,10 @@ fun case_1() {
|
||||
|
||||
-2147483649 checkType { _<Long>() }
|
||||
checkSubtype<Long>(-2147483649)
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 5
|
||||
fun case_5() {
|
||||
9223372036854775807 checkType { _<Long>() }
|
||||
checkSubtype<Long>(9223372036854775807)
|
||||
|
||||
|
||||
+20
-7
@@ -2,22 +2,26 @@
|
||||
// SKIP_TXT
|
||||
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTIONS: constant-literals, integer-literals, long-integer-literals
|
||||
PARAGRAPH: 1
|
||||
SENTENCE: [2] An integer literal with the long literal mark has type kotlin.Long; an integer literal without it has one of the types kotlin.Int/kotlin.Short/kotlin.Byte (the selected type is dependent on the context), if its value is in range of the corresponding type, or type kotlin.Long otherwise.
|
||||
NUMBER: 3
|
||||
DESCRIPTION: Type checking of hexadecimal integer literals.
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SECTIONS: constant-literals, integer-literals, long-integer-literals
|
||||
* PARAGRAPH: 1
|
||||
* SENTENCE: [2] An integer literal with the long literal mark has type kotlin.Long; an integer literal without it has one of the types kotlin.Int/kotlin.Short/kotlin.Byte (the selected type is dependent on the context), if its value is in range of the corresponding type, or type kotlin.Long otherwise.
|
||||
* NUMBER: 3
|
||||
* DESCRIPTION: Type checking of hexadecimal integer literals.
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1() {
|
||||
0x0 checkType { _<Int>() }
|
||||
checkSubtype<Int>(0x0)
|
||||
checkSubtype<Short>(0x0)
|
||||
checkSubtype<Byte>(0x0)
|
||||
checkSubtype<Long>(0x0)
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
fun case_2() {
|
||||
0x7F checkType { _<Int>() }
|
||||
checkSubtype<Int>(0x7F)
|
||||
checkSubtype<Short>(0x7F)
|
||||
@@ -39,7 +43,10 @@ fun case_1() {
|
||||
checkSubtype<Int>(-0x81)
|
||||
checkSubtype<Short>(-0x81)
|
||||
checkSubtype<Long>(-0x81)
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
fun case_3() {
|
||||
0x7FFF checkType { _<Int>() }
|
||||
checkSubtype<Int>(0x7FFF)
|
||||
checkSubtype<Short>(0x7FFF)
|
||||
@@ -57,7 +64,10 @@ fun case_1() {
|
||||
-0X8001 checkType { _<Int>() }
|
||||
checkSubtype<Int>(-0X8001)
|
||||
checkSubtype<Long>(-0X8001)
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 4
|
||||
fun case_4() {
|
||||
0x7FFFFFFF checkType { _<Int>() }
|
||||
checkSubtype<Int>(0x7FFFFFFF)
|
||||
checkSubtype<Long>(0x7FFFFFFF)
|
||||
@@ -71,7 +81,10 @@ fun case_1() {
|
||||
|
||||
-0x80000001 checkType { _<Long>() }
|
||||
checkSubtype<Long>(-0x80000001)
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 5
|
||||
fun case_5() {
|
||||
0X7FFFFFFFFFFFFFFF checkType { _<Long>() }
|
||||
checkSubtype<Long>(0X7FFFFFFFFFFFFFFF)
|
||||
|
||||
|
||||
+20
-7
@@ -2,22 +2,26 @@
|
||||
// SKIP_TXT
|
||||
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTIONS: constant-literals, integer-literals, long-integer-literals
|
||||
PARAGRAPH: 1
|
||||
SENTENCE: [2] An integer literal with the long literal mark has type kotlin.Long; an integer literal without it has one of the types kotlin.Int/kotlin.Short/kotlin.Byte (the selected type is dependent on the context), if its value is in range of the corresponding type, or type kotlin.Long otherwise.
|
||||
NUMBER: 4
|
||||
DESCRIPTION: Type checking of binary integer literals.
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SECTIONS: constant-literals, integer-literals, long-integer-literals
|
||||
* PARAGRAPH: 1
|
||||
* SENTENCE: [2] An integer literal with the long literal mark has type kotlin.Long; an integer literal without it has one of the types kotlin.Int/kotlin.Short/kotlin.Byte (the selected type is dependent on the context), if its value is in range of the corresponding type, or type kotlin.Long otherwise.
|
||||
* NUMBER: 4
|
||||
* DESCRIPTION: Type checking of binary integer literals.
|
||||
*/
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1() {
|
||||
0b0 checkType { _<Int>() }
|
||||
checkSubtype<Int>(0b0)
|
||||
checkSubtype<Short>(0b0)
|
||||
checkSubtype<Byte>(0b0)
|
||||
checkSubtype<Long>(0b0)
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
fun case_2() {
|
||||
0B1111111 checkType { _<Int>() }
|
||||
checkSubtype<Int>(0B1111111)
|
||||
checkSubtype<Short>(0B1111111)
|
||||
@@ -39,7 +43,10 @@ fun case_1() {
|
||||
checkSubtype<Int>(-0b10000001)
|
||||
checkSubtype<Short>(-0b10000001)
|
||||
checkSubtype<Long>(-0b10000001)
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
fun case_3() {
|
||||
0B111111111111111 checkType { _<Int>() }
|
||||
checkSubtype<Int>(0B111111111111111)
|
||||
checkSubtype<Short>(0B111111111111111)
|
||||
@@ -57,7 +64,10 @@ fun case_1() {
|
||||
-0B1000000000000001 checkType { _<Int>() }
|
||||
checkSubtype<Int>(-0B1000000000000001)
|
||||
checkSubtype<Long>(-0B1000000000000001)
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 4
|
||||
fun case_4() {
|
||||
0b1111111111111111111111111111111 checkType { _<Int>() }
|
||||
checkSubtype<Int>(0b1111111111111111111111111111111)
|
||||
checkSubtype<Long>(0b1111111111111111111111111111111)
|
||||
@@ -71,7 +81,10 @@ fun case_1() {
|
||||
|
||||
-0b10000000000000000000000000000001 checkType { _<Long>() }
|
||||
checkSubtype<Long>(-0b10000000000000000000000000000001)
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 5
|
||||
fun case_5() {
|
||||
0b111111111111111111111111111111111111111111111111111111111111111 checkType { _<Long>() }
|
||||
checkSubtype<Long>(0b111111111111111111111111111111111111111111111111111111111111111)
|
||||
|
||||
|
||||
+16
-8
@@ -2,37 +2,43 @@
|
||||
// SKIP_TXT
|
||||
|
||||
/*
|
||||
KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
|
||||
SECTIONS: constant-literals, integer-literals, long-integer-literals
|
||||
PARAGRAPH: 1
|
||||
SENTENCE: [2] An integer literal with the long literal mark has type kotlin.Long; an integer literal without it has one of the types kotlin.Int/kotlin.Short/kotlin.Byte (the selected type is dependent on the context), if its value is in range of the corresponding type, or type kotlin.Long otherwise.
|
||||
NUMBER: 5
|
||||
DESCRIPTION: Check of integer type selection depends on the context.
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (POSITIVE)
|
||||
*
|
||||
* SECTIONS: constant-literals, integer-literals, long-integer-literals
|
||||
* PARAGRAPH: 1
|
||||
* SENTENCE: [2] An integer literal with the long literal mark has type kotlin.Long; an integer literal without it has one of the types kotlin.Int/kotlin.Short/kotlin.Byte (the selected type is dependent on the context), if its value is in range of the corresponding type, or type kotlin.Long otherwise.
|
||||
* NUMBER: 5
|
||||
* DESCRIPTION: Check of integer type selection depends on the context.
|
||||
*/
|
||||
|
||||
// FILE: functions.kt
|
||||
|
||||
package functions
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun f1(x1: Byte, x2: Short, x3: Int, x4: Long) = x1 + x2 + x3 + x4
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
fun f2(x1: Short, x2: Int, x3: Long) = x1 + x2 + x3
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
fun f3(x1: Int, x2: Long) = x1 + x2
|
||||
|
||||
// TESTCASE NUMBER: 4
|
||||
fun f4(x1: Long) = x1
|
||||
|
||||
// FILE: usages.kt
|
||||
// FILE: main.kt
|
||||
|
||||
import functions.*
|
||||
|
||||
// TESTCASE NUMBER: 1
|
||||
fun case_1() {
|
||||
f1(0, 0, 0, 0)
|
||||
f1(127, 127, 127, 127)
|
||||
f1(-128, -128, -128, -128)
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 2
|
||||
fun case_2() {
|
||||
f2(128, 128, 128)
|
||||
f2(-129, -129, -129)
|
||||
@@ -40,6 +46,7 @@ fun case_2() {
|
||||
f2(-32768, -32768, -32768)
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 3
|
||||
fun case_3() {
|
||||
f3(32768, 32768)
|
||||
f3(-32769, -32769)
|
||||
@@ -47,6 +54,7 @@ fun case_3() {
|
||||
f3(-2147483648, -2147483648)
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 4
|
||||
fun case_4() {
|
||||
f4(2147483648)
|
||||
f4(-2147483649)
|
||||
|
||||
Reference in New Issue
Block a user