This is an automated email from the ASF dual-hosted git repository.

rubenql pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/calcite.git


The following commit(s) were added to refs/heads/main by this push:
     new 7176860882 [CALCITE-5980] QuidemTests are not effectively executed on 
Windows
7176860882 is described below

commit 717686088265aeb1a1b3ba561748c6cb64e1b1b0
Author: rubenada <rube...@gmail.com>
AuthorDate: Wed Sep 6 11:41:57 2023 +0100

    [CALCITE-5980] QuidemTests are not effectively executed on Windows
---
 testkit/src/main/java/org/apache/calcite/test/QuidemTest.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/testkit/src/main/java/org/apache/calcite/test/QuidemTest.java 
b/testkit/src/main/java/org/apache/calcite/test/QuidemTest.java
index 60bcd15c9d..aec668e469 100644
--- a/testkit/src/main/java/org/apache/calcite/test/QuidemTest.java
+++ b/testkit/src/main/java/org/apache/calcite/test/QuidemTest.java
@@ -178,6 +178,10 @@ public abstract class QuidemTest {
           .build();
       new Quidem(config).execute();
     }
+    // Sanity check: we do not allow an empty input file, it may indicate that 
it was overwritten
+    if (inFile.length() == 0) {
+      fail("Input file was empty: " + inFile + "\n");
+    }
     final String diff = DiffTestCase.diff(inFile, outFile);
     if (!diff.isEmpty()) {
       fail("Files differ: " + outFile + " " + inFile + "\n"
@@ -193,7 +197,7 @@ public abstract class QuidemTest {
    */
   private static File replaceDir(File file, String target, String replacement) 
{
     return new File(
-        file.getAbsolutePath().replace(n2u('/' + target + '/'),
+        n2u(file.getAbsolutePath()).replace(n2u('/' + target + '/'),
             n2u('/' + replacement + '/')));
   }
 

Reply via email to