Skip to content

Commit

Permalink
Refactoring: fix weak warning about unnecessary escaped dot
Browse files Browse the repository at this point in the history
  • Loading branch information
goodwinnk committed Jul 28, 2016
1 parent e7ee0d1 commit 097288d
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ import java.util.*
import java.util.regex.Pattern

@Language("RegExp") private val KT_OR_KTS = """^(.+)\.(kt|kts)$"""
@Language("RegExp") private val KT_WITHOUT_DOTS_IN_NAME = """^([^\.]+)\.kt$"""
@Language("RegExp") private val KT_WITHOUT_DOTS_IN_NAME = """^([^.]+)\.kt$"""

fun main(args: Array<String>) {
System.setProperty("java.awt.headless", "true")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void testAfterNullable() throws Exception {
}

public void testAllFilesPresentInBasic() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/idea-completion/testData/weighers/basic"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/idea-completion/testData/weighers/basic"), Pattern.compile("^([^.]+)\\.kt$"), true);
}

@TestMetadata("CallableReference_NothingLast.kt")
Expand Down Expand Up @@ -196,7 +196,7 @@ public void testAfterAs() throws Exception {
}

public void testAllFilesPresentInExpectedInfo() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/idea-completion/testData/weighers/basic/expectedInfo"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/idea-completion/testData/weighers/basic/expectedInfo"), Pattern.compile("^([^.]+)\\.kt$"), true);
}

@TestMetadata("CompanionObjectMethod.kt")
Expand Down Expand Up @@ -289,7 +289,7 @@ public void testWhenByEnum() throws Exception {
@RunWith(JUnit3RunnerWithInners.class)
public static class ParameterNameAndType extends AbstractBasicCompletionWeigherTest {
public void testAllFilesPresentInParameterNameAndType() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/idea-completion/testData/weighers/basic/parameterNameAndType"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/idea-completion/testData/weighers/basic/parameterNameAndType"), Pattern.compile("^([^.]+)\\.kt$"), true);
}

@TestMetadata("Deprecated.kt")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
@RunWith(JUnit3RunnerWithInners.class)
public class SmartCompletionWeigherTestGenerated extends AbstractSmartCompletionWeigherTest {
public void testAllFilesPresentInSmart() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/idea-completion/testData/weighers/smart"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/idea-completion/testData/weighers/smart"), Pattern.compile("^([^.]+)\\.kt$"), true);
}

@TestMetadata("BooleanExpected.kt")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
@RunWith(JUnit3RunnerWithInners.class)
public class AddImportTestGenerated extends AbstractAddImportTest {
public void testAllFilesPresentInAddImport() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/addImport"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/addImport"), Pattern.compile("^([^.]+)\\.kt$"), true);
}

@TestMetadata("CannotImportClass1.kt")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
@RunWith(JUnit3RunnerWithInners.class)
public class ExpressionSelectionTestGenerated extends AbstractExpressionSelectionTest {
public void testAllFilesPresentInExpressionSelection() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/expressionSelection"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/expressionSelection"), Pattern.compile("^([^.]+)\\.kt$"), true);
}

@TestMetadata("binaryExpr.kt")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
@RunWith(JUnit3RunnerWithInners.class)
public class SmartSelectionTestGenerated extends AbstractSmartSelectionTest {
public void testAllFilesPresentInSmartSelection() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/smartSelection"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/smartSelection"), Pattern.compile("^([^.]+)\\.kt$"), true);
}

@TestMetadata("commentsAndExtraSpaces.kt")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
@RunWith(JUnit3RunnerWithInners.class)
public class IdeCompiledLightClassTestGenerated extends AbstractIdeCompiledLightClassTest {
public void testAllFilesPresentInLightClasses() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/asJava/lightClasses"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/asJava/lightClasses"), Pattern.compile("^([^.]+)\\.kt$"), true);
}

@TestMetadata("AnnotationClass.kt")
Expand All @@ -52,7 +52,7 @@ public void testDeprecatedEnumEntry() throws Exception {
@RunWith(JUnit3RunnerWithInners.class)
public static class Delegation extends AbstractIdeCompiledLightClassTest {
public void testAllFilesPresentInDelegation() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/asJava/lightClasses/delegation"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/asJava/lightClasses/delegation"), Pattern.compile("^([^.]+)\\.kt$"), true);
}

@TestMetadata("Function.kt")
Expand All @@ -73,7 +73,7 @@ public void testProperty() throws Exception {
@RunWith(JUnit3RunnerWithInners.class)
public static class Facades extends AbstractIdeCompiledLightClassTest {
public void testAllFilesPresentInFacades() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/asJava/lightClasses/facades"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/asJava/lightClasses/facades"), Pattern.compile("^([^.]+)\\.kt$"), true);
}

@TestMetadata("MultiFile.kt")
Expand All @@ -100,7 +100,7 @@ public void testSingleJvmClassName() throws Exception {
@RunWith(JUnit3RunnerWithInners.class)
public static class NullabilityAnnotations extends AbstractIdeCompiledLightClassTest {
public void testAllFilesPresentInNullabilityAnnotations() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/asJava/lightClasses/nullabilityAnnotations"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/asJava/lightClasses/nullabilityAnnotations"), Pattern.compile("^([^.]+)\\.kt$"), true);
}

@TestMetadata("Class.kt")
Expand Down Expand Up @@ -217,7 +217,7 @@ public void testVoidReturn() throws Exception {
@RunWith(JUnit3RunnerWithInners.class)
public static class Object extends AbstractIdeCompiledLightClassTest {
public void testAllFilesPresentInObject() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/asJava/lightClasses/object"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/asJava/lightClasses/object"), Pattern.compile("^([^.]+)\\.kt$"), true);
}

@TestMetadata("SimpleObject.kt")
Expand All @@ -232,7 +232,7 @@ public void testSimpleObject() throws Exception {
@RunWith(JUnit3RunnerWithInners.class)
public static class PublicField extends AbstractIdeCompiledLightClassTest {
public void testAllFilesPresentInPublicField() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/asJava/lightClasses/publicField"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/asJava/lightClasses/publicField"), Pattern.compile("^([^.]+)\\.kt$"), true);
}

@TestMetadata("CompanionObject.kt")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class InsertImportOnPasteTestGenerated extends AbstractInsertImportOnPast
@RunWith(JUnit3RunnerWithInners.class)
public static class Copy extends AbstractInsertImportOnPasteTest {
public void testAllFilesPresentInCopy() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/copyPaste/imports"), Pattern.compile("^([^\\.]+)\\.kt$"), false);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/copyPaste/imports"), Pattern.compile("^([^.]+)\\.kt$"), false);
}

@TestMetadata("AlreadyImportedExtensions.kt")
Expand Down Expand Up @@ -397,7 +397,7 @@ public void testUnresolvedOverload() throws Exception {
@RunWith(JUnit3RunnerWithInners.class)
public static class Cut extends AbstractInsertImportOnPasteTest {
public void testAllFilesPresentInCut() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/copyPaste/imports"), Pattern.compile("^([^\\.]+)\\.kt$"), false);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/copyPaste/imports"), Pattern.compile("^([^.]+)\\.kt$"), false);
}

@TestMetadata("AlreadyImportedExtensions.kt")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
@RunWith(JUnit3RunnerWithInners.class)
public class OptimizeImportsTestGenerated extends AbstractOptimizeImportsTest {
public void testAllFilesPresentInOptimizeImports() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/editor/optimizeImports"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/editor/optimizeImports"), Pattern.compile("^([^.]+)\\.kt$"), true);
}

@TestMetadata("AlreadyOptimized.kt")
Expand Down Expand Up @@ -262,7 +262,7 @@ public void testWithAliases() throws Exception {
@RunWith(JUnit3RunnerWithInners.class)
public static class AllUnderImports extends AbstractOptimizeImportsTest {
public void testAllFilesPresentInAllUnderImports() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/editor/optimizeImports/allUnderImports"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/editor/optimizeImports/allUnderImports"), Pattern.compile("^([^.]+)\\.kt$"), true);
}

@TestMetadata("ClassNameConflict.kt")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
@RunWith(JUnit3RunnerWithInners.class)
public class ReferenceResolveTestGenerated extends AbstractReferenceResolveTest {
public void testAllFilesPresentInReferences() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/resolve/references"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/resolve/references"), Pattern.compile("^([^.]+)\\.kt$"), true);
}

@TestMetadata("AnnotationForClass.kt")
Expand Down Expand Up @@ -472,7 +472,7 @@ public void testWrongNumberOfTypeArgumentsInSupertype() throws Exception {
@RunWith(JUnit3RunnerWithInners.class)
public static class DelegatedPropertyAccessors extends AbstractReferenceResolveTest {
public void testAllFilesPresentInDelegatedPropertyAccessors() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/resolve/references/delegatedPropertyAccessors"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/resolve/references/delegatedPropertyAccessors"), Pattern.compile("^([^.]+)\\.kt$"), true);
}

@TestMetadata("unresolved.kt")
Expand All @@ -486,7 +486,7 @@ public void testUnresolved() throws Exception {
@RunWith(JUnit3RunnerWithInners.class)
public static class InSource extends AbstractReferenceResolveTest {
public void testAllFilesPresentInInSource() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/resolve/references/delegatedPropertyAccessors/inSource"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/resolve/references/delegatedPropertyAccessors/inSource"), Pattern.compile("^([^.]+)\\.kt$"), true);
}

@TestMetadata("getExtension.kt")
Expand Down Expand Up @@ -531,7 +531,7 @@ public void testGetSetPropertyDelegatedMember() throws Exception {
@RunWith(JUnit3RunnerWithInners.class)
public static class InStandardLibrary extends AbstractReferenceResolveTest {
public void testAllFilesPresentInInStandardLibrary() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/resolve/references/delegatedPropertyAccessors/inStandardLibrary"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/resolve/references/delegatedPropertyAccessors/inStandardLibrary"), Pattern.compile("^([^.]+)\\.kt$"), true);
}

@TestMetadata("lazy.kt")
Expand All @@ -553,7 +553,7 @@ public void testNotNull() throws Exception {
@RunWith(JUnit3RunnerWithInners.class)
public static class ForLoopIn extends AbstractReferenceResolveTest {
public void testAllFilesPresentInForLoopIn() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/resolve/references/forLoopIn"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/resolve/references/forLoopIn"), Pattern.compile("^([^.]+)\\.kt$"), true);
}

@TestMetadata("unresolvedIterator.kt")
Expand All @@ -567,7 +567,7 @@ public void testUnresolvedIterator() throws Exception {
@RunWith(JUnit3RunnerWithInners.class)
public static class InBuiltIns extends AbstractReferenceResolveTest {
public void testAllFilesPresentInInBuiltIns() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/resolve/references/forLoopIn/inBuiltIns"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/resolve/references/forLoopIn/inBuiltIns"), Pattern.compile("^([^.]+)\\.kt$"), true);
}

@TestMetadata("extension.kt")
Expand All @@ -588,7 +588,7 @@ public void testMember() throws Exception {
@RunWith(JUnit3RunnerWithInners.class)
public static class InLibrary extends AbstractReferenceResolveTest {
public void testAllFilesPresentInInLibrary() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/resolve/references/forLoopIn/inLibrary"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/resolve/references/forLoopIn/inLibrary"), Pattern.compile("^([^.]+)\\.kt$"), true);
}

@TestMetadata("extension.kt")
Expand All @@ -609,7 +609,7 @@ public void testAllExtensions() throws Exception {
}

public void testAllFilesPresentInInSource() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/resolve/references/forLoopIn/inSource"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/resolve/references/forLoopIn/inSource"), Pattern.compile("^([^.]+)\\.kt$"), true);
}

@TestMetadata("allMembers.kt")
Expand All @@ -631,7 +631,7 @@ public void testNextMissing() throws Exception {
@RunWith(JUnit3RunnerWithInners.class)
public static class Invoke extends AbstractReferenceResolveTest {
public void testAllFilesPresentInInvoke() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/resolve/references/invoke"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/resolve/references/invoke"), Pattern.compile("^([^.]+)\\.kt$"), true);
}

@TestMetadata("lambdaAndParens.kt")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
@RunWith(JUnit3RunnerWithInners.class)
public class KotlinFileStructureTestGenerated extends AbstractKotlinFileStructureTest {
public void testAllFilesPresentInFileStructure() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/structureView/fileStructure"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/structureView/fileStructure"), Pattern.compile("^([^.]+)\\.kt$"), true);
}

@TestMetadata("CheckLocationForKotlin.kt")
Expand Down
Loading

0 comments on commit 097288d

Please sign in to comment.