fix format bug

This commit is contained in:
Looly
2023-08-04 15:38:42 +08:00
parent 9a82679dd9
commit 790161264b
3 changed files with 28 additions and 1 deletions

View File

@@ -1,5 +1,6 @@
package org.dromara.hutool.db.sql;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
public class SqlFormatterTest {
@@ -11,4 +12,15 @@ public class SqlFormatterTest {
final String sql = "(select 1 from dual) union all (select 1 from dual)";
SqlFormatter.format(sql);
}
@Test
public void issue3246Test() {
final String sql = "select * from `order`";
final String format = SqlFormatter.format(sql);
Assertions.assertEquals(
"select\n" +
" * \n" +
" from\n" +
" `order`", format);
}
}