You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/11/18 02:51:04 UTC

[GitHub] [shardingsphere] lwtdev commented on issue #7880: Add UT for table and expr.

lwtdev commented on issue #7880:
URL: https://github.com/apache/shardingsphere/issues/7880#issuecomment-729342237


   > > > @lwtdev Now, there is no UT for expr, are you interested in fix it? The relevant issue is #7880
   > > 
   > > 
   > > @jingshanglu I don't known what should to do about the work `UT for expr`, Which ‘expr’ need to add test cases?
   > 
   > @lwtdev There is `WhereSegment` in selectStatement like this:
   > 
   > ```
   > public abstract class SelectStatement extends AbstractSQLStatement implements DMLStatement {
   >     
   >     private ProjectionsSegment projections;
   >     
   >     private TableSegment from;
   >     
   >     private WhereSegment where;
   >     
   >     private GroupBySegment groupBy;
   >     
   >     private OrderBySegment orderBy;
   > }
   > // WhereSegment contain expr
   > public final class WhereSegment implements SQLSegment {
   >     
   >     private final int startIndex;
   >     
   >     private final int stopIndex;
   >     
   >     private final ExpressionSegment expr;
   > }
   > ```
   > 
   > But in our test framework, there is no assertion of expr, like this:
   > 
   > ```
   > public final class WhereClauseAssert {
   >     
   >     /**
   >      * Assert actual where segment is correct with expected where clause.
   >      * 
   >      * @param assertContext assert context
   >      * @param actual actual where segment
   >      * @param expected expected where clause
   >      */
   >     public static void assertIs(final SQLCaseAssertContext assertContext, final WhereSegment actual, final ExpectedWhereClause expected) {
   > //        TODO support expr in where assert
   >     }
   > }
   > ```
   > 
   > just like `assertLockClause()` that you added.
   
   @jingshanglu OK, I think I get it.
   I will find "TODO" in the "shardingsphere-sql-parser-test" module. Then fix them?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org