You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by jh...@apache.org on 2019/05/22 17:25:22 UTC

[calcite] branch master updated: Oops, broke a test on Windows

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 010d2c1  Oops, broke a test on Windows
010d2c1 is described below

commit 010d2c1cd1d9683cb7d784005033211040127083
Author: Julian Hyde <jh...@apache.org>
AuthorDate: Wed May 22 09:13:13 2019 -0700

    Oops, broke a test on Windows
---
 .../org/apache/calcite/sql/parser/SqlParserTest.java   | 18 +++++++-----------
 1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java b/core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java
index 72950c8..31547a7 100644
--- a/core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java
+++ b/core/src/test/java/org/apache/calcite/sql/parser/SqlParserTest.java
@@ -8765,7 +8765,7 @@ public class SqlParserTest {
       Matcher<String> matcher) throws SqlParseException {
     final SqlParser parser = getDialectSqlParser(sql, dialect);
     final SqlNode node = parser.parseStmt();
-    assertThat(node.toSqlString(dialect).getSql(), matcher);
+    assertThat(linux(node.toSqlString(dialect).getSql()), matcher);
   }
 
   //~ Inner Interfaces -------------------------------------------------------
@@ -8797,11 +8797,8 @@ public class SqlParserTest {
         SqlNode sqlNode,
         String expected) {
       // no dialect, always parenthesize
-      String actual = sqlNode.toSqlString(null, true).getSql();
-      if (LINUXIFY.get()[0]) {
-        actual = Util.toLinux(actual);
-      }
-      TestUtil.assertEqualsVerbose(expected, actual);
+      final String actual = sqlNode.toSqlString(null, true).getSql();
+      TestUtil.assertEqualsVerbose(expected, linux(actual));
     }
 
     @Override public void checkList(
@@ -8848,11 +8845,8 @@ public class SqlParserTest {
         String sql,
         String expected) {
       final SqlNode sqlNode = parseExpressionAndHandleEx(sql);
-      String actual = sqlNode.toSqlString(null, true).getSql();
-      if (LINUXIFY.get()[0]) {
-        actual = Util.toLinux(actual);
-      }
-      TestUtil.assertEqualsVerbose(expected, actual);
+      final String actual = sqlNode.toSqlString(null, true).getSql();
+      TestUtil.assertEqualsVerbose(expected, linux(actual));
     }
 
     protected SqlNode parseExpressionAndHandleEx(String sql) {
@@ -9056,6 +9050,8 @@ public class SqlParserTest {
     }
   }
 
+  /** Converts a string to linux format (LF line endings rather than CR-LF),
+   * except if disabled in {@link #LINUXIFY}. */
   private String linux(String s) {
     if (LINUXIFY.get()[0]) {
       s = Util.toLinux(s);