Files
php-ext-xlswriter/library/libxlsxwriter/test/unit/utility/test_lxw_utf8_strlen.c
2024-03-05 10:01:08 +08:00

24 lines
539 B
C

/*
* Tests for the libxlsxwriter library.
*
* Copyright 2014-2021, John McNamara, jmcnamara@cpan.org
*
*/
#include "../ctest.h"
#include "../helper.h"
#include "../../../include/xlsxwriter/utility.h"
// Test lxw_utf8_strlen().
CTEST(utility, lxw_utf8_strlen) {
ASSERT_EQUAL(0, lxw_utf8_strlen(""));
ASSERT_EQUAL(3, lxw_utf8_strlen("Foo"));
ASSERT_EQUAL(4, lxw_utf8_strlen("café"));
ASSERT_EQUAL(4, lxw_utf8_strlen("cake"));
ASSERT_EQUAL(21, lxw_utf8_strlen("Это фраза на русском!"));
}