You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ri...@apache.org on 2026/05/19 17:24:33 UTC

svn commit: r1934406 - subversion/trunk/subversion/tests/libsvn_subr

Author: rinrab
Date: Tue May 19 17:24:33 2026
New Revision: 1934406

Log:
Test svn_utf_cstring_utf8_width() with BOM.

* subversion/tests/libsvn_subr/utf-test.c
  (test_utf8_width): Add test case.

Suggested by: ivan

Modified:
   subversion/trunk/subversion/tests/libsvn_subr/utf-test.c

Modified: subversion/trunk/subversion/tests/libsvn_subr/utf-test.c
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_subr/utf-test.c	Tue May 19 17:21:57 2026	(r1934405)
+++ subversion/trunk/subversion/tests/libsvn_subr/utf-test.c	Tue May 19 17:24:33 2026	(r1934406)
@@ -1017,11 +1017,13 @@ test_utf8_width(apr_pool_t *pool)
     "o\xcc\x80\xcc\x9b"         /* o with grave and hook */
     "\xe1\xb9\x8b";             /* n with circumflex below */
   const char *invalid = "a" "\xe6" "bc";
+  const char *bom = "\xEF\xBB\xBF" "abc";
 
   SVN_TEST_INT_ASSERT(svn_utf_cstring_utf8_width("abc123"), 6);
   SVN_TEST_INT_ASSERT(svn_utf_cstring_utf8_width(fat_emojis), 3);
   SVN_TEST_INT_ASSERT(svn_utf_cstring_utf8_width(mixup), 10);
   SVN_TEST_INT_ASSERT(svn_utf_cstring_utf8_width(invalid), -1);
+  SVN_TEST_INT_ASSERT(svn_utf_cstring_utf8_width(bom), 3);
 
   return SVN_NO_ERROR;
 }