|
9 | 9 | */ |
10 | 10 | package net.sf.jsqlparser.expression.operators.relational; |
11 | 11 |
|
| 12 | +import static org.junit.jupiter.api.Assertions.*; |
| 13 | + |
12 | 14 | import net.sf.jsqlparser.JSQLParserException; |
13 | 15 | import net.sf.jsqlparser.expression.Expression; |
14 | 16 | import net.sf.jsqlparser.expression.StringValue; |
15 | 17 | import net.sf.jsqlparser.parser.CCJSqlParserUtil; |
16 | 18 | import net.sf.jsqlparser.test.TestUtils; |
17 | 19 | import org.junit.jupiter.api.Test; |
18 | 20 |
|
19 | | -import static org.junit.jupiter.api.Assertions.*; |
20 | | - |
21 | 21 | /** |
22 | 22 | * |
23 | 23 | * @author Tobias Warneke (t.warneke@gmx.net) |
@@ -58,4 +58,44 @@ void testDuckDBSimuilarTo() throws JSQLParserException { |
58 | 58 | + " ORDER BY v;"; |
59 | 59 | TestUtils.assertSqlCanBeParsedAndDeparsed(sqlStr, true); |
60 | 60 | } |
| 61 | + |
| 62 | + @Test |
| 63 | + public void testMatchAny() throws JSQLParserException { |
| 64 | + TestUtils.assertSqlCanBeParsedAndDeparsed( |
| 65 | + "select * from dual where v MATCH_ANY 'keyword1 keyword2'", true); |
| 66 | + TestUtils.assertSqlCanBeParsedAndDeparsed( |
| 67 | + "select * from dual where v NOT MATCH_ANY 'keyword1 keyword2'", true); |
| 68 | + } |
| 69 | + |
| 70 | + @Test |
| 71 | + public void testMatchAll() throws JSQLParserException { |
| 72 | + TestUtils.assertSqlCanBeParsedAndDeparsed( |
| 73 | + "select * from dual where v MATCH_ALL 'keyword1 keyword2'", true); |
| 74 | + TestUtils.assertSqlCanBeParsedAndDeparsed( |
| 75 | + "select * from dual where v NOT MATCH_ALL 'keyword1 keyword2'", true); |
| 76 | + } |
| 77 | + |
| 78 | + @Test |
| 79 | + public void testMatchPhrase() throws JSQLParserException { |
| 80 | + TestUtils.assertSqlCanBeParsedAndDeparsed( |
| 81 | + "select * from dual where v MATCH_PHRASE 'keyword1 keyword2'", true); |
| 82 | + TestUtils.assertSqlCanBeParsedAndDeparsed( |
| 83 | + "select * from dual where v NOT MATCH_PHRASE 'keyword1 keyword2'", true); |
| 84 | + } |
| 85 | + |
| 86 | + @Test |
| 87 | + public void testMatchPhrasePrefix() throws JSQLParserException { |
| 88 | + TestUtils.assertSqlCanBeParsedAndDeparsed( |
| 89 | + "select * from dual where v MATCH_PHRASE_PREFIX 'keyword1 keyword2'", true); |
| 90 | + TestUtils.assertSqlCanBeParsedAndDeparsed( |
| 91 | + "select * from dual where v NOT MATCH_PHRASE_PREFIX 'keyword1 keyword2'", true); |
| 92 | + } |
| 93 | + |
| 94 | + @Test |
| 95 | + public void testMatchRegexp() throws JSQLParserException { |
| 96 | + TestUtils.assertSqlCanBeParsedAndDeparsed( |
| 97 | + "select * from dual where v MATCH_REGEXP 'keyword1 keyword2'", true); |
| 98 | + TestUtils.assertSqlCanBeParsedAndDeparsed( |
| 99 | + "select * from dual where v NOT MATCH_REGEXP 'keyword1 keyword2'", true); |
| 100 | + } |
61 | 101 | } |
0 commit comments