mirror of
https://github.com/ascii-boxes/boxes.git
synced 2025-08-17 02:01:33 +02:00
Add u32_insert_space_at() to 'unicode' module
This commit is contained in:
@ -26,6 +26,7 @@
|
||||
#include <cmocka.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistr.h>
|
||||
|
||||
#include "boxes.h"
|
||||
#include "tools.h"
|
||||
@ -183,4 +184,26 @@ void test_u32_strnrstr(void **state)
|
||||
}
|
||||
|
||||
|
||||
|
||||
void test_u32_insert_space_at(void **state)
|
||||
{
|
||||
UNUSED(state);
|
||||
|
||||
uint32_t *expected = u32_strconv_from_arg("x xxx ", "ASCII");
|
||||
assert_non_null(expected);
|
||||
uint32_t *s = u32_strconv_from_arg("xxxx", "ASCII");
|
||||
assert_non_null(s);
|
||||
|
||||
u32_insert_space_at(NULL, 2, 3);
|
||||
u32_insert_space_at(&s, 3, 0);
|
||||
u32_insert_space_at(&s, 1, 1);
|
||||
u32_insert_space_at(&s, 10000, 2);
|
||||
|
||||
assert_int_equal(0, u32_strcmp(expected, s));
|
||||
|
||||
BFREE(s);
|
||||
BFREE(expected);
|
||||
}
|
||||
|
||||
|
||||
/* vim: set cindent sw=4: */
|
Reference in New Issue
Block a user