tests: add prof_send_raw

Allow sending byte sequences to the Profanity PTY without a newline.
Now we can simulate control characters, specifically the `TAB` key
(`\t`), to trigger autocompletion.
This commit is contained in:
Michael Vetter
2026-03-19 08:50:58 +01:00
parent e9c6b3b3d8
commit ee0d325648
2 changed files with 9 additions and 0 deletions

View File

@@ -397,6 +397,14 @@ prof_input(const char* input)
usleep(1000 * 100); // 100ms delay
}
void
prof_send_raw(const char* bytes)
{
write(fd, bytes, strlen(bytes));
tcdrain(fd);
usleep(1000 * 100);
}
int
prof_output_exact(const char* text)
{

View File

@@ -28,6 +28,7 @@ void prof_start(void);
void prof_connect(void);
void prof_connect_with_roster(const char* roster);
void prof_input(const char* input);
void prof_send_raw(const char* bytes);
int prof_output_exact(const char* text);
int prof_output_regex(const char* text);