singhpratech commented on code in PR #51237:
URL: https://github.com/apache/arrow/pull/51237#discussion_r3958460897


##########
cpp/src/arrow/compute/kernels/scalar_string_test.cc:
##########
@@ -1245,7 +1245,7 @@ TYPED_TEST(TestStringKernels, Utf8Normalize) {
 
   // decomposed: U+0061(LATIN SMALL LETTER A) + U+0301(COMBINING ACUTE ACCENT)
   // composed: U+00E1(LATIN SMALL LETTER A WITH ACUTE)
-  const char* json_composed = "[\"foo\", \"á\"]";
+  const char* json_composed = "[\"foo\", \"\xc3\xa1\"]";

Review Comment:
   The literal on main renders as á, but its bytes are `61 cc 81`,
   `a` followed by U+0301, the decomposed form, so it was the same string as 
`json_decomposed` on the
   next line and the compose assertions below compared a value with itself. 
That is why the test passed
   with the bug (Santoshkumarpuppala spotted it on the issue). To check:
   
   ```
   git show main:cpp/src/arrow/compute/kernels/scalar_string_test.cc | sed -n 
1248p | xxd
   ...  5c22 61cc 815c 22 ...
   ```
   
   `\xc3\xa1` is U+00E1 in UTF-8, which is what the comment describes. I used 
the escape so the two
   fixtures are visibly different in the source, the way `json_decomposed` 
already is; happy to write the
   literal `á` (composed, `c3 a1`) instead, or add the byte values to the 
comment, whichever you prefer.
   



-- 
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]

Reply via email to