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

Commit 8cbc011

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 8cbc011

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ public Statement apply(Statement stmt, FrameworkMethod meth, Object arg2) {
2121
String versionString = Properties.versionString();
2222

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

0 commit comments

Comments
 (0)