[ https://issues.apache.org/jira/browse/HAWQ-810?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15328772#comment-15328772 ]
ASF GitHub Bot commented on HAWQ-810: ------------------------------------- Github user huor commented on a diff in the pull request: https://github.com/apache/incubator-hawq/pull/707#discussion_r66898131 --- Diff: src/test/feature/testlib/test_lib.cpp --- @@ -73,6 +74,11 @@ TEST_F(TestCommonLib, TestSqlUtil) { util.execSQLFile("testlib/sql/sample.sql", "testlib/ans/sample.ans"); } +TEST_F(TestCommonLib, TestStringFormat) { + auto s1 = hawq::test::stringFormat("welcome %s to apache %s project", "you", "HAWQ"); + EXPECT_EQ(s1, "welcome you to apache HAWQ project"); --- End diff -- ``` auto s1 = hawq::test::stringFormat("Welcome to apache %s project", "HAWQ"); + EXPECT_EQ(s1, "Welcome to apache HAWQ project"); ``` or ``` auto s1 = hawq::test::stringFormat("%s are welcome to apache %s project", "You", "HAWQ"); + EXPECT_EQ(s1, "You are welcome to apache HAWQ project"); ``` > Add string format for feature test library > ------------------------------------------ > > Key: HAWQ-810 > URL: https://issues.apache.org/jira/browse/HAWQ-810 > Project: Apache HAWQ > Issue Type: New Feature > Components: Tests > Reporter: hongwu > Assignee: hongwu > > For example, define a string: > {noformat} > std::string s = stringFormat("hello %s %s world", "xunzhang", "wuhong"); > {noformat} > instead of: > {noformat} > std::string s = "hello" + "xunzhang" + "wuhong" + "world"; > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)