13 #include <CUnit/CUnit.h>
16 #include "nomos_gap.h"
29 buf=g_strdup_printf(
"\377abc\377\377de\377\377fg\377hi");
33 for(guint i=0; i<po->len; ++i) {
35 CU_ASSERT_EQUAL(*(buf+thePoA->pos), *(fer+thePoA->pos+thePoA->off));
37 g_array_free(po,TRUE);
53 buf=g_strdup_printf(
"\377abc\377\377de\377\377fg\377hi");
57 for(
size_t i=0; i< strlen(buf); i++){
58 CU_ASSERT_EQUAL( *(buf+i) , *(fer + uncollapsePosition(i,po)) );
60 g_array_free(po,TRUE);
76 buf=g_strdup_printf(
" abc d e fghi");
79 for(guint i=0; i<po->len; ++i) {
81 CU_ASSERT_EQUAL(*(buf+thePoA->pos), *(fer+thePoA->pos+thePoA->off));
83 g_array_free(po,TRUE);
99 buf=g_strdup_printf(
" abc d e fghi");
102 for(
size_t i=0; i< strlen(buf); i++){
103 CU_ASSERT_EQUAL( *(buf+i) , *(fer + uncollapsePosition(i,po)) );
105 g_array_free(po,TRUE);
110 CU_TestInfo nomos_gap_testcases[] = {
GArray * collapseInvisible(char *text, char invisible)
GArray * collapseSpaces(char *text)
void test_collapseInvisible()
Test for collapseInvisible()
void test_uncollapseInvisible()
Test for uncollapsePosition() on collapseInvisible()
void test_collapseSpaces()
Test for collapseSpaces()
void test_uncollapseSpaces()
Test for uncollapsePosition() on collapseSpaces()