Unify script file extensions to "kts" so that IDEA, compiler and tests agree when to parse as SCRIPT.
Include kt* files into formatter test generation, to test scripting formatting
This commit is contained in:
committed by
Andrey Breslav
parent
4ba423ee16
commit
98c54f39bb
@@ -1,3 +1,3 @@
|
||||
-printArgs
|
||||
-script
|
||||
$TESTDATA_DIR$/hello.ktscript
|
||||
$TESTDATA_DIR$/hello.kts
|
||||
@@ -1,3 +1,3 @@
|
||||
INFO: Invoking compiler org.jetbrains.jet.cli.jvm.K2JVMCompiler with arguments -printArgs -script compiler/testData/cli/jvm/hello.ktscript
|
||||
INFO: Invoking compiler org.jetbrains.jet.cli.jvm.K2JVMCompiler with arguments -printArgs -script compiler/testData/cli/jvm/hello.kts
|
||||
hello
|
||||
OK
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
-script
|
||||
$TESTDATA_DIR$/script.ktscript
|
||||
$TESTDATA_DIR$/script.kts
|
||||
hi
|
||||
there
|
||||
@@ -1,4 +1,4 @@
|
||||
JetFile: ComplexScript.ktscript
|
||||
JetFile: ComplexScript.kts
|
||||
PACKAGE_DIRECTIVE
|
||||
<empty list>
|
||||
SCRIPT
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
JetFile: Import.ktscript
|
||||
JetFile: Import.kts
|
||||
PACKAGE_DIRECTIVE
|
||||
<empty list>
|
||||
SCRIPT
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
JetFile: Shebang.ktscript
|
||||
JetFile: Shebang.kts
|
||||
PsiComment(SHEBANG_COMMENT)('#!/usr/bin/env kotlin')
|
||||
PsiWhiteSpace('\n\n')
|
||||
PACKAGE_DIRECTIVE
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
JetFile: ShebangIncorrect.ktscript
|
||||
JetFile: ShebangIncorrect.kts
|
||||
PACKAGE_DIRECTIVE
|
||||
<empty list>
|
||||
SCRIPT
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
JetFile: SimpleScript.ktscript
|
||||
JetFile: SimpleScript.kts
|
||||
PACKAGE_DIRECTIVE
|
||||
<empty list>
|
||||
SCRIPT
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
>>> fun foo() = 765
|
||||
null
|
||||
>>> foo(1)
|
||||
ERROR: /line2.ktscript: (1, 5) Too many arguments for internal final fun foo(): kotlin.Int defined in <script>
|
||||
ERROR: /line2.kts: (1, 5) Too many arguments for internal final fun foo(): kotlin.Int defined in <script>
|
||||
>>> foo()
|
||||
765
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
>>> )(
|
||||
ERROR: /line1.ktscript: (1, 1) Expecting an element
|
||||
ERROR: /line1.ktscript: (1, 3) Expecting an expression
|
||||
ERROR: /line1.kts: (1, 1) Expecting an element
|
||||
ERROR: /line1.kts: (1, 3) Expecting an expression
|
||||
>>> fun foo() = 98
|
||||
null
|
||||
>>> foo()
|
||||
|
||||
Reference in New Issue
Block a user