File: test_buffer_get_offset.c

package info (click to toggle)
mle 1.7.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,108 kB
  • sloc: ansic: 13,335; sh: 728; php: 228; makefile: 83
file content (22 lines) | stat: -rw-r--r-- 559 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "test.h"

char *str = "hello\nworld";

void test(buffer_t *buf, mark_t *cur) {
    bint_t offset;

    buffer_get_offset(buf, buf->first_line, 0, &offset);
    ASSERT("f0", 0, offset);

    buffer_get_offset(buf, buf->first_line, 1, &offset);
    ASSERT("f1", 1, offset);

    buffer_get_offset(buf, buf->first_line, 5, &offset);
    ASSERT("f5", 5, offset);

    buffer_get_offset(buf, buf->first_line->next, 0, &offset);
    ASSERT("n0", 6, offset);

    buffer_get_offset(buf, buf->first_line->next, 6, &offset);
    ASSERT("noob", 11, offset);
}