Skip to content

Commit

Permalink
Fix classpath string splitting on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
koral-- committed Dec 22, 2023
1 parent 26bd453 commit 07c504a
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class KotlinPitestPluginFunctionalSpec extends AbstractPitestFunctionalSpec {
}

void "should run mutation analysis with kotlin Android plugin"() {
Assume.assumeFalse("PatternSyntaxException: Unexpected internal error near index 1 on Windows", System.getProperty("os.name", "unknown").toLowerCase(Locale.ROOT).contains("win"))
when:
copyResources("testProjects/simpleKotlin", "")
then:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package pl.droidsonroids.gradle.pitest.functional

import groovy.transform.CompileDynamic
import nebula.test.functional.ExecutionResult
import org.junit.Assume
import org.junit.Rule
import org.junit.rules.TemporaryFolder
import pl.droidsonroids.gradle.pitest.PitestPlugin
Expand Down Expand Up @@ -182,7 +181,6 @@ class PitestPluginGeneralFunctionalSpec extends AbstractPitestFunctionalSpec {

@Issue("https://github.com/koral--/gradle-pitest-plugin/issues/87")
void "should write reports for each variant separately"() {
Assume.assumeFalse("PatternSyntaxException: Unexpected internal error near index 1 on Windows", System.getProperty("os.name", "unknown").toLowerCase(Locale.ROOT).contains("win"))
given:
copyResources("testProjects/simpleKotlin", "")
and:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,9 @@ class PitestPlugin implements Plugin<Project> {
detectInlinedCode.set(pitestExtension.detectInlinedCode)
timestampedReports.set(pitestExtension.timestampedReports)
additionalClasspath.setFrom({
String splitter = File.separator.replace("\\", "\\\\")
FileCollection filteredCombinedTaskClasspath = combinedTaskClasspath.filter { File file ->
if (pitestExtension.excludeMockableAndroidJar.getOrElse(false) && file.name == 'android.jar' && file.absolutePath.split(File.separator).contains('platforms')) {
if (pitestExtension.excludeMockableAndroidJar.getOrElse(false) && file.name == 'android.jar' && file.absolutePath.split(splitter).contains('platforms')) {
return false
} else {
return !pitestExtension.fileExtensionsToFilter.getOrElse([]).find { extension -> file.name.endsWith(".$extension") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import org.gradle.api.GradleException
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.testfixtures.ProjectBuilder
import org.junit.Assume
import spock.lang.Issue
import spock.lang.Specification

Expand All @@ -47,7 +46,6 @@ class PitestPluginTest extends Specification {

@Issue("https://github.com/koral--/gradle-pitest-plugin/issues/116")
void "excludes mockable Android JAR"() {
Assume.assumeFalse(System.getProperty("os.name", "unknown").toLowerCase(Locale.ROOT).contains("win"))
when:
Project project = AndroidUtils.createSampleLibraryProject()
project.android {
Expand Down

0 comments on commit 07c504a

Please sign in to comment.