Skip to content

Commit e78c8ef

Browse files
author
Hélios GILLES
committed
Fix jump with *
1 parent 3e0f95c commit e78c8ef

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

org.moreunit.core/src/org/moreunit/core/matching/CamelCaseNameTokenizer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ private String nextWord(WordScanner scanner)
1515
scanner.forward();
1616
if(scanner.hasNext() //
1717
&& (Character.isUpperCase(scanner.next()) //
18-
|| (Character.isDigit(scanner.next()) && ! Character.isDigit(scanner.current()))))
18+
|| ('_' == scanner.next()) //
19+
|| (Character.isDigit(scanner.next()) && !Character.isDigit(scanner.current()))))
1920
{
2021
break;
2122
}

org.moreunit.core/src/org/moreunit/core/matching/TestFileNamePattern.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
package org.moreunit.core.matching;
22

33
import static java.util.Arrays.asList;
4-
import static java.util.Collections.emptyList;
5-
import static java.util.Collections.emptySet;
6-
import static java.util.Collections.sort;
4+
import static java.util.Collections.*;
75
import static java.util.regex.Matcher.quoteReplacement;
8-
import static java.util.regex.Pattern.compile;
9-
import static java.util.regex.Pattern.quote;
6+
import static java.util.regex.Pattern.*;
107

118
import java.util.ArrayList;
129
import java.util.Collection;
@@ -276,6 +273,8 @@ private static String toPrefixPattern(UserDefinedPart part)
276273

277274
private static String toSuffixPattern(UserDefinedPart part)
278275
{
276+
if("*".equals(part.raw()))
277+
return ".*";
279278
if(! part.hasAlternatives())
280279
return "";
281280

@@ -471,7 +470,7 @@ private FileNameEvaluation buildTestFileResult(String fileBaseName)
471470
private String buildPreferredSrcFileName(String testFileName)
472471
{
473472
String maybeSeparator = String.format("(%s)?", quote(separator));
474-
return testFileName.replaceFirst("^" + prefix + maybeSeparator, "").replaceFirst(maybeSeparator + suffix + "$", "");
473+
return testFileName.replaceFirst("^" + prefix + maybeSeparator, "").replaceFirst(maybeSeparator + (suffix.equals(".*") ? "" : suffix) + "$", "");
475474
}
476475

477476
/**
@@ -517,7 +516,6 @@ private List<String> buildOtherCorrespondingSrcFilePatterns(String preferredName
517516
private FileNameEvaluation buildSrcFileResult(String srcFileName)
518517
{
519518
String preferredTestFileName = buildPreferredTestFileName(srcFileName);
520-
;
521519

522520
String quotedSrcFileName = quote(srcFileName);
523521

@@ -585,7 +583,7 @@ else if(! prefixPart.hasAlternatives())
585583
{
586584
if(! suffixPart.hasAlternatives())
587585
{
588-
result.add(toPattern(prefixPart, preAlt) + quotedSrcFileName);
586+
result.add(toPattern(prefixPart, preAlt) + quotedSrcFileName + toSuffixPattern(suffixPart));
589587
}
590588
else
591589
{

org.moreunit.plugin/src/org/moreunit/elements/EditorPartFacade.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public EditorPartFacade(IEditorPart editorPart)
3434
{
3535
checkNotNull(editorPart, "Can not wrap a null editor part");
3636
this.editorPart = editorPart;
37-
this.file = (IFile) editorPart.getEditorInput().getAdapter(IFile.class);
37+
this.file = editorPart.getEditorInput().getAdapter(IFile.class);
3838
}
3939

4040
public IFile getFile()
@@ -128,8 +128,6 @@ else if(javaElement instanceof IType && ((IType) javaElement).isAnonymous() && j
128128
{
129129
method = (IMethod) javaElement.getParent();
130130
}
131-
else
132-
LogHandler.getInstance().handleInfoLog("No method found surrounding cursor position.");
133131
}
134132
catch (JavaModelException e)
135133
{

org.moreunit.plugin/src/org/moreunit/wizards/MoreUnitWizardPageOne.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,7 @@ private void saveWidgetValues()
13281328
@Override
13291329
protected String getCompilationUnitName(String typeName)
13301330
{
1331-
if(langType == LanguageType.GROOVY || spockToggle.getSelection())
1331+
if(langType == LanguageType.GROOVY || isSpockSelected())
13321332
{
13331333
return typeName + GROOVY_FILE_SUFFIX;
13341334
}

0 commit comments

Comments
 (0)