diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/jsCode/argumentIsLiteral.kt b/compiler/testData/diagnostics/testsWithJsStdLib/jsCode/argumentIsLiteral.kt new file mode 100644 index 00000000000..12b96554aaf --- /dev/null +++ b/compiler/testData/diagnostics/testsWithJsStdLib/jsCode/argumentIsLiteral.kt @@ -0,0 +1,19 @@ +val a = "1" + +fun nonConst(): String = "1" + +fun test() { + val b = "b" + + js(a) + js(b) + js("$a") + js("${1}") + js("$b;") + js("${b}bb") + js(a + a) + js("a" + "a") + js("ccc") + + js(nonConst()) +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/jsCode/argumentIsLiteral.txt b/compiler/testData/diagnostics/testsWithJsStdLib/jsCode/argumentIsLiteral.txt new file mode 100644 index 00000000000..9249c4a3c0f --- /dev/null +++ b/compiler/testData/diagnostics/testsWithJsStdLib/jsCode/argumentIsLiteral.txt @@ -0,0 +1,5 @@ +package + +internal val a: kotlin.String = "1" +internal fun nonConst(): kotlin.String +internal fun test(): kotlin.Unit diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/jsCode/error.kt b/compiler/testData/diagnostics/testsWithJsStdLib/jsCode/error.kt new file mode 100644 index 00000000000..645295ba0de --- /dev/null +++ b/compiler/testData/diagnostics/testsWithJsStdLib/jsCode/error.kt @@ -0,0 +1,25 @@ +val code = """ + var s = "hello" + + ); +""" + +fun main(args: Array): Unit { + js("var = 10;") + + js("""var = 10;""") + + js("""var + = 777; + """) + + js(""" + var = 777; + """) + + js("var " + " = " + "10;") + + val n = 10 + js("var = $n;") + + js(code) +} diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/jsCode/error.txt b/compiler/testData/diagnostics/testsWithJsStdLib/jsCode/error.txt new file mode 100644 index 00000000000..bc9fb784300 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithJsStdLib/jsCode/error.txt @@ -0,0 +1,7 @@ +package + +internal val code: kotlin.String = " + var s = "hello" + + ); +" +internal fun main(/*0*/ args: kotlin.Array): kotlin.Unit diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/jsCode/warning.kt b/compiler/testData/diagnostics/testsWithJsStdLib/jsCode/warning.kt new file mode 100644 index 00000000000..e3e13b239fa --- /dev/null +++ b/compiler/testData/diagnostics/testsWithJsStdLib/jsCode/warning.kt @@ -0,0 +1,10 @@ +fun main(args: Array): Unit { + js("var a = 08;") + + js("""var a = + + 08;""") + + val code = "var a = 08;" + js(code) +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithJsStdLib/jsCode/warning.txt b/compiler/testData/diagnostics/testsWithJsStdLib/jsCode/warning.txt new file mode 100644 index 00000000000..dc8f04a7788 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithJsStdLib/jsCode/warning.txt @@ -0,0 +1,3 @@ +package + +internal fun main(/*0*/ args: kotlin.Array): kotlin.Unit diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestWithJsStdLibGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestWithJsStdLibGenerated.java index ef1809a6b98..581bc160d3e 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestWithJsStdLibGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestWithJsStdLibGenerated.java @@ -30,7 +30,7 @@ import java.util.regex.Pattern; @SuppressWarnings("all") @TestMetadata("compiler/testData/diagnostics/testsWithJsStdLib") @TestDataPath("$PROJECT_ROOT") -@InnerTestClasses({JetDiagnosticsTestWithJsStdLibGenerated.DynamicTypes.class, JetDiagnosticsTestWithJsStdLibGenerated.Native.class}) +@InnerTestClasses({JetDiagnosticsTestWithJsStdLibGenerated.DynamicTypes.class, JetDiagnosticsTestWithJsStdLibGenerated.JsCode.class, JetDiagnosticsTestWithJsStdLibGenerated.Native.class}) @RunWith(JUnit3RunnerWithInners.class) public class JetDiagnosticsTestWithJsStdLibGenerated extends AbstractJetDiagnosticsTestWithJsStdLib { public void testAllFilesPresentInTestsWithJsStdLib() throws Exception { @@ -226,6 +226,33 @@ public class JetDiagnosticsTestWithJsStdLibGenerated extends AbstractJetDiagnost } } + @TestMetadata("compiler/testData/diagnostics/testsWithJsStdLib/jsCode") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class JsCode extends AbstractJetDiagnosticsTestWithJsStdLib { + public void testAllFilesPresentInJsCode() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithJsStdLib/jsCode"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("argumentIsLiteral.kt") + public void testArgumentIsLiteral() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithJsStdLib/jsCode/argumentIsLiteral.kt"); + doTest(fileName); + } + + @TestMetadata("error.kt") + public void testError() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithJsStdLib/jsCode/error.kt"); + doTest(fileName); + } + + @TestMetadata("warning.kt") + public void testWarning() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithJsStdLib/jsCode/warning.kt"); + doTest(fileName); + } + } + @TestMetadata("compiler/testData/diagnostics/testsWithJsStdLib/native") @TestDataPath("$PROJECT_ROOT") @InnerTestClasses({Native.NativeGetter.class, Native.NativeInvoke.class, Native.NativeSetter.class, Native.OptionlBody.class, Native.UnusedParam.class}) diff --git a/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt b/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt index 938e94b3d5a..0d4ed8f64db 100644 --- a/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt +++ b/generators/src/org/jetbrains/kotlin/generators/tests/GenerateTests.kt @@ -50,7 +50,6 @@ import org.jetbrains.kotlin.completion.AbstractJvmBasicCompletionTest import org.jetbrains.kotlin.completion.AbstractJvmWithLibBasicCompletionTest import org.jetbrains.kotlin.idea.navigation.AbstractGotoSuperTest import org.jetbrains.kotlin.idea.quickfix.AbstractQuickFixMultiFileTest -import org.jetbrains.kotlin.idea.highlighter.AbstractHighlightingTest import org.jetbrains.kotlin.idea.folding.AbstractKotlinFoldingTest import org.jetbrains.kotlin.idea.codeInsight.surroundWith.AbstractSurroundWithTest import org.jetbrains.kotlin.idea.intentions.AbstractIntentionTest @@ -66,7 +65,6 @@ import org.jetbrains.kotlin.idea.resolve.AbstractReferenceResolveWithLibTest import org.jetbrains.kotlin.findUsages.AbstractJetFindUsagesTest import org.jetbrains.kotlin.idea.configuration.AbstractConfigureProjectByChangingFileTest import org.jetbrains.kotlin.formatter.AbstractJetFormatterTest -import org.jetbrains.kotlin.idea.highlighter.AbstractDiagnosticMessageTest import org.jetbrains.kotlin.idea.codeInsight.AbstractOutOfBlockModificationTest import org.jetbrains.kotlin.completion.AbstractDataFlowValueRenderingTest import org.jetbrains.kotlin.resolve.annotation.AbstractAnnotationParameterTest @@ -143,6 +141,7 @@ import org.jetbrains.kotlin.codegen.AbstractLineNumberTest import org.jetbrains.kotlin.completion.handlers.AbstractKeywordCompletionHandlerTest import org.jetbrains.kotlin.idea.kdoc.AbstractKDocHighlightingTest import org.jetbrains.kotlin.addImport.AbstractAddImportTest +import org.jetbrains.kotlin.idea.highlighter.* fun main(args: Array) { System.setProperty("java.awt.headless", "true") @@ -570,7 +569,11 @@ fun main(args: Array) { } testClass(javaClass()) { - model("diagnosticMessage") + model("diagnosticMessage", recursive = false) + } + + testClass(javaClass()) { + model("diagnosticMessage/js", recursive = false, targetBackend = TargetBackend.JS) } testClass(javaClass()) { diff --git a/idea/testData/diagnosticMessage/js/jsCodeErrorHtml.kt b/idea/testData/diagnosticMessage/js/jsCodeErrorHtml.kt new file mode 100644 index 00000000000..bf48bea109a --- /dev/null +++ b/idea/testData/diagnosticMessage/js/jsCodeErrorHtml.kt @@ -0,0 +1,19 @@ +// !DIAGNOSTICS_NUMBER: 4 +// !DIAGNOSTICS: JSCODE_ERROR +// !MESSAGE_TYPE: HTML + +fun box() { + val i = "i" + val n = 10 + + js("var = $n;") + + js("""var a = 10; + var = $n; + var c = 15;""") + + js("""for (var $i = + )""") + + js("var = 10;") +} \ No newline at end of file diff --git a/idea/testData/diagnosticMessage/js/jsCodeErrorHtml1.html b/idea/testData/diagnosticMessage/js/jsCodeErrorHtml1.html new file mode 100644 index 00000000000..a7742a82348 --- /dev/null +++ b/idea/testData/diagnosticMessage/js/jsCodeErrorHtml1.html @@ -0,0 +1,3 @@ + + +JavaScript: missing variable name in code:
var      = 10;
\ No newline at end of file diff --git a/idea/testData/diagnosticMessage/js/jsCodeErrorHtml2.html b/idea/testData/diagnosticMessage/js/jsCodeErrorHtml2.html new file mode 100644 index 00000000000..2d89d5f8e3d --- /dev/null +++ b/idea/testData/diagnosticMessage/js/jsCodeErrorHtml2.html @@ -0,0 +1,5 @@ + + +JavaScript: missing variable name in code:
var a = 10;
+    var      = 10;
+    var c = 15;
\ No newline at end of file diff --git a/idea/testData/diagnosticMessage/js/jsCodeErrorHtml3.html b/idea/testData/diagnosticMessage/js/jsCodeErrorHtml3.html new file mode 100644 index 00000000000..a3e0e4b5ffd --- /dev/null +++ b/idea/testData/diagnosticMessage/js/jsCodeErrorHtml3.html @@ -0,0 +1,4 @@ + + +JavaScript: syntax error in code:
for (var i =
+    )
\ No newline at end of file diff --git a/idea/testData/diagnosticMessage/js/jsCodeErrorHtml4.html b/idea/testData/diagnosticMessage/js/jsCodeErrorHtml4.html new file mode 100644 index 00000000000..00b68da1b81 --- /dev/null +++ b/idea/testData/diagnosticMessage/js/jsCodeErrorHtml4.html @@ -0,0 +1,3 @@ + + +JavaScript: missing variable name \ No newline at end of file diff --git a/idea/testData/diagnosticMessage/js/jsCodeErrorText.kt b/idea/testData/diagnosticMessage/js/jsCodeErrorText.kt new file mode 100644 index 00000000000..ec634635a4a --- /dev/null +++ b/idea/testData/diagnosticMessage/js/jsCodeErrorText.kt @@ -0,0 +1,19 @@ +// !DIAGNOSTICS_NUMBER: 4 +// !DIAGNOSTICS: JSCODE_ERROR +// !MESSAGE_TYPE: TEXT + +fun box() { + val i = "i" + val n = 10 + + js("var = $n;") + + js("""var a = 10; + var = $n; + var c = 15;""") + + js("""for (var $i = + )""") + + js("var = 10;") +} \ No newline at end of file diff --git a/idea/testData/diagnosticMessage/js/jsCodeErrorText1.txt b/idea/testData/diagnosticMessage/js/jsCodeErrorText1.txt new file mode 100644 index 00000000000..5229edad66a --- /dev/null +++ b/idea/testData/diagnosticMessage/js/jsCodeErrorText1.txt @@ -0,0 +1,4 @@ + +JavaScript: missing variable name in code: +var = 10; + ^^^^^^^^ \ No newline at end of file diff --git a/idea/testData/diagnosticMessage/js/jsCodeErrorText2.txt b/idea/testData/diagnosticMessage/js/jsCodeErrorText2.txt new file mode 100644 index 00000000000..0507ef9d68b --- /dev/null +++ b/idea/testData/diagnosticMessage/js/jsCodeErrorText2.txt @@ -0,0 +1,6 @@ + +JavaScript: missing variable name in code: +var a = 10; + var = 10; + ^^^^^^^^ + var c = 15; \ No newline at end of file diff --git a/idea/testData/diagnosticMessage/js/jsCodeErrorText3.txt b/idea/testData/diagnosticMessage/js/jsCodeErrorText3.txt new file mode 100644 index 00000000000..e7b5ca79d7e --- /dev/null +++ b/idea/testData/diagnosticMessage/js/jsCodeErrorText3.txt @@ -0,0 +1,6 @@ + +JavaScript: syntax error in code: +for (var i = + ^ + ) +^^^^^ \ No newline at end of file diff --git a/idea/testData/diagnosticMessage/js/jsCodeErrorText4.txt b/idea/testData/diagnosticMessage/js/jsCodeErrorText4.txt new file mode 100644 index 00000000000..03bc2454468 --- /dev/null +++ b/idea/testData/diagnosticMessage/js/jsCodeErrorText4.txt @@ -0,0 +1,2 @@ + +JavaScript: missing variable name \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/highlighter/AbstractDiagnosticMessageJsTest.java b/idea/tests/org/jetbrains/kotlin/idea/highlighter/AbstractDiagnosticMessageJsTest.java new file mode 100644 index 00000000000..0d652cdc2b2 --- /dev/null +++ b/idea/tests/org/jetbrains/kotlin/idea/highlighter/AbstractDiagnosticMessageJsTest.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010-2015 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.idea.highlighter; + +import com.google.common.base.Predicates; +import com.intellij.psi.PsiFile; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.kotlin.analyzer.AnalysisResult; +import org.jetbrains.kotlin.cli.jvm.compiler.EnvironmentConfigFiles; +import org.jetbrains.kotlin.cli.jvm.compiler.JetCoreEnvironment; +import org.jetbrains.kotlin.config.CompilerConfiguration; +import org.jetbrains.kotlin.idea.PluginTestCaseBase; +import org.jetbrains.kotlin.js.analyze.TopDownAnalyzerFacadeForJS; +import org.jetbrains.kotlin.js.config.Config; +import org.jetbrains.kotlin.js.config.EcmaVersion; +import org.jetbrains.kotlin.js.config.LibrarySourcesConfigWithCaching; +import org.jetbrains.kotlin.js.resolve.diagnostics.ErrorsJs; +import org.jetbrains.kotlin.psi.JetFile; + +import java.lang.reflect.Field; + +import static java.util.Collections.singletonList; + +public abstract class AbstractDiagnosticMessageJsTest extends AbstractDiagnosticMessageTest { + @NotNull + @Override + protected JetCoreEnvironment createEnvironment() { + return JetCoreEnvironment.createForTests(getTestRootDisposable(), new CompilerConfiguration(), EnvironmentConfigFiles.JS_CONFIG_FILES); + } + + @NotNull + @Override + protected AnalysisResult analyze(@NotNull JetFile file) { + return TopDownAnalyzerFacadeForJS.analyzeFiles(singletonList(file), Predicates.alwaysTrue(), getConfig()); + } + + @NotNull + @Override + protected String getTestDataPath() { + return PluginTestCaseBase.getTestDataPathBase() + "/diagnosticMessage/js/"; + } + + @Nullable + @Override + protected Field getPlatformSpecificDiagnosticField(@NotNull String diagnosticName) { + return getFieldOrNull(ErrorsJs.class, diagnosticName); + } + + @NotNull + private Config getConfig() { + return new LibrarySourcesConfigWithCaching(getProject(), + "testModule", + EcmaVersion.defaultVersion(), + /* sourceMap = */ false, + /* inlineEnabled = */ false, + /* isUnitTestMode = */ true); + } +} diff --git a/idea/tests/org/jetbrains/kotlin/idea/highlighter/AbstractDiagnosticMessageTest.java b/idea/tests/org/jetbrains/kotlin/idea/highlighter/AbstractDiagnosticMessageTest.java index 44bfeab0a46..6eb6c8f3868 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/highlighter/AbstractDiagnosticMessageTest.java +++ b/idea/tests/org/jetbrains/kotlin/idea/highlighter/AbstractDiagnosticMessageTest.java @@ -17,6 +17,7 @@ package org.jetbrains.kotlin.idea.highlighter; import com.google.common.collect.Sets; +import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.util.Condition; import com.intellij.openapi.util.io.FileUtil; import com.intellij.util.containers.ContainerUtil; @@ -29,8 +30,10 @@ import org.jetbrains.kotlin.diagnostics.DiagnosticFactory; import org.jetbrains.kotlin.diagnostics.Errors; import org.jetbrains.kotlin.diagnostics.rendering.DefaultErrorMessages; import org.jetbrains.kotlin.idea.PluginTestCaseBase; +import org.jetbrains.kotlin.js.resolve.diagnostics.ErrorsJs; import org.jetbrains.kotlin.psi.JetFile; import org.jetbrains.kotlin.resolve.BindingContext; +import org.jetbrains.kotlin.resolve.jvm.diagnostics.ErrorsJvm; import org.jetbrains.kotlin.resolve.lazy.JvmResolveUtil; import org.jetbrains.kotlin.test.ConfigurationKind; import org.jetbrains.kotlin.test.JetLiteFixture; @@ -61,16 +64,23 @@ public abstract class AbstractDiagnosticMessageTest extends JetLiteFixture { } } + @NotNull @Override protected JetCoreEnvironment createEnvironment() { return createEnvironmentWithMockJdk(ConfigurationKind.JDK_ONLY); } + @NotNull @Override protected String getTestDataPath() { return PluginTestCaseBase.getTestDataPathBase() + "/diagnosticMessage/"; } + @NotNull + protected AnalysisResult analyze(@NotNull JetFile file) { + return JvmResolveUtil.analyzeOneFileWithJavaIntegration(file); + } + public void doTest(String filePath) throws Exception { File file = new File(filePath); String fileName = file.getName(); @@ -82,7 +92,7 @@ public abstract class AbstractDiagnosticMessageTest extends JetLiteFixture { MessageType messageType = getMessageTypeDirective(directives); JetFile psiFile = createPsiFile(null, fileName, loadFile(fileName)); - AnalysisResult analysisResult = JvmResolveUtil.analyzeOneFileWithJavaIntegration(psiFile); + AnalysisResult analysisResult = analyze(psiFile); BindingContext bindingContext = analysisResult.getBindingContext(); List diagnostics = ContainerUtil.filter(bindingContext.getDiagnostics().all(), new Condition() { @@ -128,33 +138,50 @@ public abstract class AbstractDiagnosticMessageTest extends JetLiteFixture { } @NotNull - private static Set> getDiagnosticFactories(Map directives) { + private Set> getDiagnosticFactories(Map directives) { String diagnosticsData = directives.get(DIAGNOSTICS_DIRECTIVE); assert diagnosticsData != null : DIAGNOSTICS_DIRECTIVE + " should be present."; Set> diagnosticFactories = Sets.newHashSet(); String[] diagnostics = diagnosticsData.split(" "); for (String diagnosticName : diagnostics) { - String errorMessage = "Can't load diagnostic factory for " + diagnosticName; - try { - Field field = Errors.class.getField(diagnosticName); - Object value = field.get(null); - if (value instanceof DiagnosticFactory) { - diagnosticFactories.add((DiagnosticFactory)value); - } - else { - throw new AssertionError(errorMessage); - } - } - catch (NoSuchFieldException e) { - throw new AssertionError(errorMessage); - } - catch (IllegalAccessException e) { - throw new AssertionError(errorMessage); - } + Object diagnostic = getDiagnostic(diagnosticName); + assert diagnostic instanceof DiagnosticFactory: "Can't load diagnostic factory for " + diagnosticName; + diagnosticFactories.add((DiagnosticFactory) diagnostic); } return diagnosticFactories; } + @Nullable + private Object getDiagnostic(@NotNull String diagnosticName) { + Field field = getPlatformSpecificDiagnosticField(diagnosticName); + + if (field == null) { + field = getFieldOrNull(Errors.class, diagnosticName); + } + + if (field == null) return null; + + try { + return field.get(null); + } catch (IllegalAccessException e) { + return null; + } + } + + @Nullable + protected Field getPlatformSpecificDiagnosticField(@NotNull String diagnosticName) { + return getFieldOrNull(ErrorsJvm.class, diagnosticName); + } + + @Nullable + protected static Field getFieldOrNull(@NotNull Class kind, @NotNull String field) { + try { + return kind.getField(field); + } catch (NoSuchFieldException e) { + return null; + } + } + @Nullable private static MessageType getMessageTypeDirective(Map directives) { String messageType = directives.get(MESSAGE_TYPE_DIRECTIVE); diff --git a/idea/tests/org/jetbrains/kotlin/idea/highlighter/DiagnosticMessageJsTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/highlighter/DiagnosticMessageJsTestGenerated.java new file mode 100644 index 00000000000..2ccfe13f830 --- /dev/null +++ b/idea/tests/org/jetbrains/kotlin/idea/highlighter/DiagnosticMessageJsTestGenerated.java @@ -0,0 +1,50 @@ +/* + * Copyright 2010-2015 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.idea.highlighter; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.InnerTestClasses; +import org.jetbrains.kotlin.test.JUnit3RunnerWithInners; +import org.jetbrains.kotlin.test.JetTestUtils; +import org.jetbrains.kotlin.test.TestMetadata; +import org.junit.runner.RunWith; + +import java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("idea/testData/diagnosticMessage/js") +@TestDataPath("$PROJECT_ROOT") +@RunWith(JUnit3RunnerWithInners.class) +public class DiagnosticMessageJsTestGenerated extends AbstractDiagnosticMessageJsTest { + public void testAllFilesPresentInJs() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/diagnosticMessage/js"), Pattern.compile("^(.+)\\.kt$"), false); + } + + @TestMetadata("jsCodeErrorHtml.kt") + public void testJsCodeErrorHtml() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/diagnosticMessage/js/jsCodeErrorHtml.kt"); + doTest(fileName); + } + + @TestMetadata("jsCodeErrorText.kt") + public void testJsCodeErrorText() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/diagnosticMessage/js/jsCodeErrorText.kt"); + doTest(fileName); + } +} diff --git a/idea/tests/org/jetbrains/kotlin/idea/highlighter/DiagnosticMessageTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/highlighter/DiagnosticMessageTestGenerated.java index e6a059d6c87..61ebcf9fe27 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/highlighter/DiagnosticMessageTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/highlighter/DiagnosticMessageTestGenerated.java @@ -33,7 +33,7 @@ import java.util.regex.Pattern; @RunWith(JUnit3RunnerWithInners.class) public class DiagnosticMessageTestGenerated extends AbstractDiagnosticMessageTest { public void testAllFilesPresentInDiagnosticMessage() throws Exception { - JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/diagnosticMessage"), Pattern.compile("^(.+)\\.kt$"), true); + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/diagnosticMessage"), Pattern.compile("^(.+)\\.kt$"), false); } @TestMetadata("assignedButNeverAccessedVariable.kt")