Skip to content

Commit

Permalink
Enaable unit test on windows build to get better understanding why it…
Browse files Browse the repository at this point in the history
… breaks
  • Loading branch information
paul-dingemans committed Aug 27, 2022
1 parent 2736e3f commit 33de17a
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ package com.pinterest.ktlint.internal

import com.google.common.jimfs.Configuration
import com.google.common.jimfs.Jimfs
import com.pinterest.ktlint.core.initKtLintKLogger
import java.io.File
import java.nio.file.FileSystem
import java.nio.file.Files
import java.nio.file.Path
import java.util.Locale
import mu.KotlinLogging
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.AfterEach
import org.junit.jupiter.api.Assumptions.assumeTrue
Expand All @@ -18,6 +20,8 @@ import org.junit.jupiter.api.condition.OS
import org.junit.jupiter.params.ParameterizedTest
import org.junit.jupiter.params.provider.ValueSource

private val logger = KotlinLogging.logger {}.initKtLintKLogger()

/**
* Tests for [fileSequence] method.
*/
Expand Down Expand Up @@ -242,9 +246,16 @@ internal class FileUtilsFileSequenceTest {
}

// Jimfs does not currently support the Windows syntax for an absolute path on the current drive (e.g. "\foo\bar")
@DisabledOnOs(OS.WINDOWS)
// @DisabledOnOs(OS.WINDOWS)
@Test
fun `Given a (relative) directory path (but not a glob) from the workdir then find all files in that workdir and it subdirectories having the default kotlin extensions`() {
logger.info {
val patterns = "src/main/kotlin".normalizeGlob()
val dir = "${rootDir}project1".normalizePath()
"`Given a (relative) directory path (but not a glob) from the workdir then find all files in that workdir and it subdirectories having the default kotlin extensions`\n" +
"\tpatterns = $patterns\n" +
"\trootDir = $dir"
}
val foundFiles = getFiles(
patterns = listOf("src/main/kotlin".normalizeGlob()),
rootDir = tempFileSystem.getPath("${rootDir}project1".normalizePath()),
Expand Down Expand Up @@ -296,6 +307,11 @@ internal class FileUtilsFileSequenceTest {
.fileSequence(patterns, rootDir)
.map { it.toString() }
.toList()
.also {
logger.info {
"Getting files with [patterns = $patterns] and [rootdir = $rootDir] returns [files = $it]"
}
}
}

internal val rawGlobSeparator: String get() {
Expand Down

0 comments on commit 33de17a

Please sign in to comment.