Do some basic housekeeping in LIBC_STR

This commit is contained in:
Justine Tunney 2023-05-10 06:17:20 -07:00
parent 12a33858c9
commit 4e81d3277c
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
7 changed files with 13 additions and 128 deletions

View file

@ -16,8 +16,8 @@
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
*/
#include "libc/intrin/bits.h"
#include "libc/str/str.h"
#include "libc/intrin/bits.h"
#include "libc/testlib/testlib.h"
TEST(strlen16, testEmpty) {
@ -31,12 +31,10 @@ TEST(strlen16, testUnicode) {
EXPECT_EQ(28, strlen16(u"αcτµαlly pδrταblε εxεcµταblε"));
}
TEST(strclen, testAegeanNumberSupplementaryPlane) {
TEST(len, testAegeanNumberSupplementaryPlane) {
EXPECT_EQ(36, strlen("𐄷𐄸𐄹𐄺𐄻𐄼𐄽𐄾𐄿"));
EXPECT_EQ(18, strlen16(u"𐄷𐄸𐄹𐄺𐄻𐄼𐄽𐄾𐄿"));
EXPECT_EQ(9, wcslen(L"𐄷𐄸𐄹𐄺𐄻𐄼𐄽𐄾𐄿"));
EXPECT_EQ(9, strclen("𐄷𐄸𐄹𐄺𐄻𐄼𐄽𐄾𐄿"));
EXPECT_EQ(9, strclen16(u"𐄷𐄸𐄹𐄺𐄻𐄼𐄽𐄾𐄿"));
EXPECT_EQ(9, wcslen(L"𐄷𐄸𐄹𐄺𐄻𐄼𐄽𐄾𐄿"));
}