diff options
| author | Berke Güzel <wenekar1@gmail.com> | 2026-10-15 11:37:31 +0300 |
|---|---|---|
| committer | Berke Güzel <wenekar1@gmail.com> | 2026-10-15 11:37:31 +0300 |
| commit | af6a37b1c4509c7766933a7cb45d2ee9a3a23f98 (patch) | |
| tree | e7b0294ebf0d9b124b8885a76c119d7f46d5b0fb /tests/term_test.c | |
| parent | acd338ea33de36d223cc6d301712eed4a9501e6c (diff) | |
Return owned text and share cell attribute flags with snapshots
Make text queries return allocated strings released with term_text_free, keeping each capture atomic. Align public attributes with the write core, remove snapshot conversion tables, and migrate tests and the Kitty adapter.
Diffstat (limited to 'tests/term_test.c')
| -rw-r--r-- | tests/term_test.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/term_test.c b/tests/term_test.c index 3721720..66dbd96 100644 --- a/tests/term_test.c +++ b/tests/term_test.c @@ -1811,16 +1811,15 @@ static void test_concurrent_feed_and_snapshot(void) (void)c; /* Every reader is safe while another thread feeds. */ - char buf[256]; term_select_start(t, (struct term_vector2i){ .x = 0, .y = 0 }, false, TERM_SELECT_WORD); term_select_extend(t, (struct term_vector2i){ .x = 40, .y = 10 }, false); (void)term_has_selection(t); - (void)term_selection_text(t, buf, sizeof(buf)); - (void)term_link_at(t, (struct term_vector2i){ .x = 1, .y = 1 }, buf, sizeof(buf)); - (void)term_cwd(t, buf, sizeof(buf)); - (void)term_pointer_shape(t, buf, sizeof(buf)); + term_text_free(term_selection_text(t)); + term_text_free(term_link_at(t, (struct term_vector2i){ .x = 1, .y = 1 })); + term_text_free(term_cwd(t)); + term_text_free(term_pointer_shape(t)); (void)term_history_rows(t); - (void)term_history_text(t, 5, buf, sizeof(buf)); + term_text_free(term_history_text(t, 5)); struct term_scrollback sb = term_scrollback(t); assert(sb.offset >= 0 && sb.total >= 0); } |
