-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Unit test for ExpressionSegmentBinder #28883
Added Unit test for ExpressionSegmentBinder #28883
Conversation
@strongduanmu - Kindly review and merge this PR. |
...a/org/apache/shardingsphere/infra/binder/segment/expression/ExpressionSegmentBinderTest.java
Outdated
Show resolved
Hide resolved
...a/org/apache/shardingsphere/infra/binder/segment/expression/ExpressionSegmentBinderTest.java
Outdated
Show resolved
Hide resolved
...a/org/apache/shardingsphere/infra/binder/segment/expression/ExpressionSegmentBinderTest.java
Outdated
Show resolved
Hide resolved
@strongduanmu - Kindly re-review and merge it. Thanks |
@strongduanmu - Is there any review pending? |
SQLStatementBinderContext statementBinderContext = new SQLStatementBinderContext(new ShardingSphereMetaData(), "db", new MockedDatabaseType(), Collections.emptyList()); | ||
ExpressionSegment actual = ExpressionSegmentBinder.bind(binaryOperationExpression, SegmentType.INSERT_COLUMNS, statementBinderContext, Collections.emptyMap(), Collections.emptyMap()); | ||
assertTrue(actual instanceof BinaryOperationExpression); | ||
assertThat(binaryOperationExpression.getLeft(), is(((BinaryOperationExpression) actual).getLeft())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this logic is wrong, and the segment that passes through bind will be regenerated. Whether you can assert the actual type and instance, the type should be same, and instance is different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Gowrishankar04, can you take a look at this recommend?
Since this pr has long time no reponse, I will close it. You are welcome to submit another PR based on comment. |
Fixes #28538.
Changes proposed in this pull request:
Added Unit test for ExpressionSegmentBinder
Before committing this PR, I'm sure that I have checked the following options:
./mvnw clean install -B -T1C -Dmaven.javadoc.skip -Dmaven.jacoco.skip -e
.