From 64f323bdfab75b995261b203a7b9a2464bf1b2b0 Mon Sep 17 00:00:00 2001
From: Sebastian Schuberth <sebastian@doubleopen.org>
Date: Thu, 12 Dec 2024 14:52:34 +0100
Subject: [PATCH] fix(evaluator): Use invariant paths in `ProjectSourceRule`

This fixes `ProjectSourceRuleTest` on Windows.

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
---
 evaluator/src/main/kotlin/ProjectSourceRule.kt | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/evaluator/src/main/kotlin/ProjectSourceRule.kt b/evaluator/src/main/kotlin/ProjectSourceRule.kt
index 1840af54e1814..3e16d57380a84 100644
--- a/evaluator/src/main/kotlin/ProjectSourceRule.kt
+++ b/evaluator/src/main/kotlin/ProjectSourceRule.kt
@@ -69,7 +69,8 @@ open class ProjectSourceRule(
      */
     fun projectSourceFindDirectories(vararg patterns: String): List<File> =
         projectSourcesDir.walkBottomUp().filterTo(mutableListOf()) {
-            it.isDirectory && FileMatcher.match(patterns.asList(), it.relativeTo(projectSourcesDir).path)
+            val path = it.relativeTo(projectSourcesDir).invariantSeparatorsPath
+            it.isDirectory && FileMatcher.match(patterns.asList(), path)
         }
 
     /**
@@ -77,7 +78,8 @@ open class ProjectSourceRule(
      */
     fun projectSourceFindFiles(vararg patterns: String): List<File> =
         projectSourcesDir.walkBottomUp().filterTo(mutableListOf()) {
-            it.isFile && FileMatcher.match(patterns.asList(), it.relativeTo(projectSourcesDir).path)
+            val path = it.relativeTo(projectSourcesDir).invariantSeparatorsPath
+            it.isFile && FileMatcher.match(patterns.asList(), path)
         }
 
     /**