File: test_mark_swap_with_mark.c

package info (click to toggle)
mle 1.3-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,508 kB
  • sloc: ansic: 9,582; sh: 383; php: 228; makefile: 82
file content (15 lines) | stat: -rw-r--r-- 421 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include "test.h"

char *str = "hello\nworld";

void test(buffer_t *buf, mark_t *cur) {
    mark_t *other;
    other = buffer_add_mark(buf, NULL, 0);
    mark_move_beginning(cur);
    mark_move_end(other);
    mark_swap_with_mark(cur, other);
    ASSERT("end", buf->first_line->next, cur->bline);
    ASSERT("endcol", 5, cur->col);
    ASSERT("beg", buf->first_line, other->bline);
    ASSERT("begcol", 0, other->col);
}