Skip to content
This repository was archived by the owner on Sep 3, 2020. It is now read-only.

Commit 829804d

Browse files
committed
Be more precise about matching scala versions
now, f.e. "2.10" will no longer match on scala 2.12.10
1 parent 89ea359 commit 829804d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/test/java/scala/tools/refactoring/tests/util/ScalaVersionTestRule.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ public void evaluate() throws Throwable {
1818

1919
public Statement apply(Statement stmt, FrameworkMethod meth, Object arg2) {
2020
ScalaVersion onlyOn = meth.getAnnotation(ScalaVersion.class);
21-
String versionString = Properties.versionString();
21+
String versionNumberString = Properties.versionNumberString();
2222

2323
if (onlyOn != null) {
24-
if (!onlyOn.doesNotMatch().isEmpty() && versionString.contains(onlyOn.doesNotMatch())) {
24+
if (!onlyOn.doesNotMatch().isEmpty() && versionNumberString.startsWith(onlyOn.doesNotMatch())) {
2525
return new EmptyStatement();
26-
} else if (versionString.contains(onlyOn.matches())) {
26+
} else if (versionNumberString.startsWith(onlyOn.matches())) {
2727
return stmt;
2828
} else {
2929
return new EmptyStatement();

0 commit comments

Comments
 (0)