FIR IDE: add additional tests for expression types
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
val x = <expr>1 + 2</expr>
|
||||
// RESULT
|
||||
|
||||
// expression: 1 + 2
|
||||
// type: kotlin.Int
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
fun x(): Int {
|
||||
for(i in 1..2) {
|
||||
<expr>break</expr>
|
||||
}
|
||||
}
|
||||
// RESULT
|
||||
|
||||
// expression: break
|
||||
// type: kotlin.Nothing
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
val a = 12
|
||||
val x = <expr>12.toByte()</expr>
|
||||
// RESULT
|
||||
|
||||
// expression: 12.toByte()
|
||||
// type: kotlin.Byte
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
val x = <expr>(1 + 2)</expr> + 3
|
||||
// RESULT
|
||||
|
||||
// expression: (1 + 2)
|
||||
// type: kotlin.Int
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
val a = 10
|
||||
val x = "abc${<expr>a</expr>}defg"
|
||||
// RESULT
|
||||
|
||||
// expression: a
|
||||
// type: kotlin.Int
|
||||
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
val a = 10
|
||||
val x = "abc${<expr>a</expr> + 20}defg"
|
||||
// RESULT
|
||||
|
||||
// expression: a
|
||||
// type: kotlin.Int
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
val x = <expr>1</expr>
|
||||
// RESULT
|
||||
|
||||
// expression: 1
|
||||
// type: kotlin.Int
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
fun x(): Int {
|
||||
<expr>return 1</expr>
|
||||
}
|
||||
// RESULT
|
||||
|
||||
// expression: return 1
|
||||
// type: kotlin.Nothing
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
val x = <expr>"abc"</expr>
|
||||
// RESULT
|
||||
|
||||
// expression: "abc"
|
||||
// type: kotlin.String
|
||||
|
||||
+44
@@ -34,11 +34,55 @@ public class HLExpressionTypeTestGenerated extends AbstractHLExpressionTypeTest
|
||||
runTest("idea/idea-frontend-fir/testData/components/expressionType/assignmentExpressionTarget.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("binaryExpression.kt")
|
||||
public void testBinaryExpression() throws Exception {
|
||||
runTest("idea/idea-frontend-fir/testData/components/expressionType/binaryExpression.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("breakExpression.kt")
|
||||
public void testBreakExpression() throws Exception {
|
||||
runTest("idea/idea-frontend-fir/testData/components/expressionType/breakExpression.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forExpression.kt")
|
||||
public void testForExpression() throws Exception {
|
||||
runTest("idea/idea-frontend-fir/testData/components/expressionType/forExpression.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("functionCall.kt")
|
||||
public void testFunctionCall() throws Exception {
|
||||
runTest("idea/idea-frontend-fir/testData/components/expressionType/functionCall.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("inParens.kt")
|
||||
public void testInParens() throws Exception {
|
||||
runTest("idea/idea-frontend-fir/testData/components/expressionType/inParens.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("insideStringTemplate.kt")
|
||||
public void testInsideStringTemplate() throws Exception {
|
||||
runTest("idea/idea-frontend-fir/testData/components/expressionType/insideStringTemplate.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("insideStringTemplateWithBinrary.kt")
|
||||
public void testInsideStringTemplateWithBinrary() throws Exception {
|
||||
runTest("idea/idea-frontend-fir/testData/components/expressionType/insideStringTemplateWithBinrary.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("intLiteral.kt")
|
||||
public void testIntLiteral() throws Exception {
|
||||
runTest("idea/idea-frontend-fir/testData/components/expressionType/intLiteral.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("returnExpression.kt")
|
||||
public void testReturnExpression() throws Exception {
|
||||
runTest("idea/idea-frontend-fir/testData/components/expressionType/returnExpression.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("stringLiteral.kt")
|
||||
public void testStringLiteral() throws Exception {
|
||||
runTest("idea/idea-frontend-fir/testData/components/expressionType/stringLiteral.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("whileExpression.kt")
|
||||
public void testWhileExpression() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user