-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90faa3e
commit a84e466
Showing
5 changed files
with
142 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
mybatis-plus-extension/src/test/java/com/baomidou/mybatisplus/test/SqlParserUtilsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.baomidou.mybatisplus.test; | ||
|
||
import com.baomidou.mybatisplus.extension.toolkit.SqlParserUtils; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class SqlParserUtilsTest { | ||
|
||
@Test | ||
void testRemoveWrapperSymbol() { | ||
//用SQLServer的人喜欢写这种 | ||
Assertions.assertEquals(SqlParserUtils.removeWrapperSymbol("[Demo]"), "Demo"); | ||
Assertions.assertEquals(SqlParserUtils.removeWrapperSymbol("Demo"), "Demo"); | ||
//mysql比较常见 | ||
Assertions.assertEquals(SqlParserUtils.removeWrapperSymbol("`Demo`"), "Demo"); | ||
//用关键字表的 | ||
Assertions.assertEquals(SqlParserUtils.removeWrapperSymbol("\"Demo\""), "Demo"); | ||
//这种少 | ||
Assertions.assertEquals(SqlParserUtils.removeWrapperSymbol("<Demo>"), "Demo"); | ||
} | ||
|
||
} |