summaryrefslogtreecommitdiff
path: root/tests/osc_test.c
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-15 11:37:31 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-15 11:37:31 +0300
commitaf6a37b1c4509c7766933a7cb45d2ee9a3a23f98 (patch)
treee7b0294ebf0d9b124b8885a76c119d7f46d5b0fb /tests/osc_test.c
parentacd338ea33de36d223cc6d301712eed4a9501e6c (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/osc_test.c')
-rw-r--r--tests/osc_test.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/osc_test.c b/tests/osc_test.c
index 91b51d6..41a9247 100644
--- a/tests/osc_test.c
+++ b/tests/osc_test.c
@@ -259,11 +259,13 @@ static void test_osc8(void)
term_free(t);
}
-static bool text_is(size_t (*get)(const struct term *, char *, size_t),
+static bool text_is(char *(*get)(const struct term *),
const struct term *t, const char *want)
{
- char buf[256];
- return get(t, buf, sizeof(buf)) == strlen(want) && !strcmp(buf, want);
+ char *text = get(t);
+ bool same = text && !strcmp(text, want);
+ term_text_free(text);
+ return same;
}
static void test_osc_misc(void)
@@ -304,7 +306,7 @@ static void test_osc_misc(void)
write_seq(t, "\033]22;text\007");
assert(text_is(term_pointer_shape, t, "text"));
write_seq(t, "\033]22;\033\\");
- assert(!term_pointer_shape(t, NULL, 0));
+ assert(!term_pointer_shape(t));
term_free(t);
}