yangzhg commented on a change in pull request #6605:
URL: https://github.com/apache/incubator-doris/pull/6605#discussion_r705989065
##########
File path: be/test/exprs/string_functions_test.cpp
##########
@@ -559,6 +559,11 @@ TEST_F(StringFunctionsTest, replace) {
ASSERT_EQ(StringVal("http://华夏zhongguo:9090"),
StringFunctions::replace(ctx, StringVal("http://中国hello:9090"),
StringVal("中国hello"),
StringVal("华夏zhongguo")));
+
+ //old substring is at the beginning of string
+ ASSERT_EQ(StringVal("ftp://www.baidu.com:9090"),
+ StringFunctions::replace(ctx,
StringVal("http://www.baidu.com:9090"),
+ StringVal("http"), StringVal("ftp")));
Review comment:
better add an empty string case
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]