From 7b77ce58a5bfdcb20b122caa890626360f2b1764 Mon Sep 17 00:00:00 2001 From: Evgeny Gerashchenko Date: Fri, 3 Apr 2015 22:04:42 +0300 Subject: [PATCH] Added assertion. There should be either space symbol after prefix (e.g., //ABSENT: A) or no symbols at all (e.g. //RUNTIME). --- .../org/jetbrains/kotlin/test/InTextDirectivesUtils.java | 3 +++ .../kotlin/idea/JetLightCodeInsightFixtureTestCase.java | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/compiler/tests/org/jetbrains/kotlin/test/InTextDirectivesUtils.java b/compiler/tests/org/jetbrains/kotlin/test/InTextDirectivesUtils.java index 03c8b366aa0..9d07268c6f8 100644 --- a/compiler/tests/org/jetbrains/kotlin/test/InTextDirectivesUtils.java +++ b/compiler/tests/org/jetbrains/kotlin/test/InTextDirectivesUtils.java @@ -117,6 +117,9 @@ public final class InTextDirectivesUtils { Character.isWhitespace(prefix.charAt(prefix.length() - 1))) { result.add(noPrefixLine.trim()); break; + } else { + throw new AssertionError( + "Line starts with prefix \"" + prefix + "\", but doesn't have space symbol after it: " + line); } } } diff --git a/idea/tests/org/jetbrains/kotlin/idea/JetLightCodeInsightFixtureTestCase.java b/idea/tests/org/jetbrains/kotlin/idea/JetLightCodeInsightFixtureTestCase.java index d5772947f75..7e442025e38 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/JetLightCodeInsightFixtureTestCase.java +++ b/idea/tests/org/jetbrains/kotlin/idea/JetLightCodeInsightFixtureTestCase.java @@ -102,12 +102,12 @@ public abstract class JetLightCodeInsightFixtureTestCase extends LightCodeInsigh if (!withLibraryDirective.isEmpty()) { return new JdkAndMockLibraryProjectDescriptor(PluginTestCaseBase.getTestDataPathBase() + "/" + withLibraryDirective.get(0), true); } - else if (InTextDirectivesUtils.isDirectiveDefined(fileText, "RUNTIME")) { - return JetWithJdkAndRuntimeLightProjectDescriptor.INSTANCE; - } else if (InTextDirectivesUtils.isDirectiveDefined(fileText, "RUNTIME_WITH_SOURCES")) { return ProjectDescriptorWithStdlibSources.INSTANCE; } + else if (InTextDirectivesUtils.isDirectiveDefined(fileText, "RUNTIME")) { + return JetWithJdkAndRuntimeLightProjectDescriptor.INSTANCE; + } else if (InTextDirectivesUtils.isDirectiveDefined(fileText, "JS")) { return JetStdJSProjectDescriptor.INSTANCE; }