edponce commented on a change in pull request #11023:
URL: https://github.com/apache/arrow/pull/11023#discussion_r706461838
##########
File path: cpp/src/arrow/compute/kernels/scalar_string_test.cc
##########
@@ -557,6 +558,36 @@ TYPED_TEST(TestStringKernels, Utf8Title) {
R"([null, "", "B", "Aaaz;Zææ&", "Ɑɽɽow", "Ii", "Ⱥ.Ⱥ.Ⱥ..Ⱥ", "Hello,
World!", "Foo Bar;Héhé0Zop", "!%$^.,;"])");
}
+TYPED_TEST(TestStringKernels, StrRepeat) {
+ auto values = ArrayFromJSON(
+ this->type(),
+ R"(["aAazZæÆ&", null, "", "b", "ɑɽⱤoW", "ıI", "ⱥⱥⱥȺ", "hEllO, WoRld!",
"$. A3", "!ɑⱤⱤow"])");
+ std::vector<std::pair<int, std::string>> repeats_and_expected{{
+ {-1, R"(["", null, "", "", "", "", "", "", "", ""])"},
+ {0, R"(["", null, "", "", "", "", "", "", "", ""])"},
+ {1,
+ R"(["aAazZæÆ&", null, "", "b", "ɑɽⱤoW", "ıI", "ⱥⱥⱥȺ", "hEllO, WoRld!",
"$. A3", "!ɑⱤⱤow"])"},
+ {3,
+ R"(["aAazZæÆ&aAazZæÆ&aAazZæÆ&", null, "", "bbb", "ɑɽⱤoWɑɽⱤoWɑɽⱤoW",
"ıIıIıI", "ⱥⱥⱥȺⱥⱥⱥȺⱥⱥⱥȺ", "hEllO, WoRld!hEllO, WoRld!hEllO, WoRld!", "$. A3$.
A3$. A3", "!ɑⱤⱤow!ɑⱤⱤow!ɑⱤⱤow"])"},
+ }};
+
+ for (const auto& pair : repeats_and_expected) {
+ auto repeat = pair.first;
+ auto expected = pair.second;
+ this->CheckVarArgs("str_repeat", {values, Datum(repeat)}, this->type(),
expected);
Review comment:
I added tests for `repeat` input of different integer types.
--
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]