Skip to content

Commit 83e98da

Browse files
committed
add test for paste_join_multiline
1 parent 9d2429c commit 83e98da

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

tests/fe-text/test-paste-join-multiline.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,18 @@ static void test_paste_join_multiline(const paste_join_multiline_test_case *test
1212
paste_join_multiline_test_case const paste_join_multiline_fixture[] = {
1313
{
1414
.description = "Lines should be joined, separator NL",
15-
.input = "<User> hello world\n how are you\n screen is narrow",
16-
.result = "<User> hello world how are you screen is narrow",
15+
.input = "<User> A1\n B22\n C33",
16+
.result = "<User> A1 B22 C33",
17+
},
18+
{
19+
.description = "Lines should be joined, separator LF",
20+
.input = "<User> A1\r B22\r C33",
21+
.result = "<User> A1 B22 C33",
22+
},
23+
{
24+
.description = "Lines should be joined, white space should be skipped",
25+
.input = "<User> A1 \n B22 \n C33 ",
26+
.result = "<User> A1 B22 C33 ",
1727
},
1828
};
1929

@@ -37,10 +47,12 @@ int main(int argc, char **argv)
3747

3848
static void test_paste_join_multiline(const paste_join_multiline_test_case *test)
3949
{
40-
char *resultstr;
50+
char *resultstr, *t1;
4151
GArray *buffer = g_array_new(FALSE, FALSE, sizeof(unichar));
4252

4353
g_test_message("Testing: %s", test->description);
54+
g_test_message("INPUT: \"%s\"", (t1 = g_strescape(test->input, NULL)));
55+
g_free(t1);
4456

4557
buffer->data = (char *) g_utf8_to_ucs4_fast(test->input, -1, (glong *) &buffer->len);
4658
paste_buffer_join_lines(buffer);

0 commit comments

Comments
 (0)