jitters/tests/unit/common.c

16 lines
301 B
C
Raw Normal View History

2020-09-29 20:35:51 +02:00
#include <criterion/redirect.h>
void redirect_streams(void)
{
cr_redirect_stdin();
cr_redirect_stdout();
cr_redirect_stderr();
}
void write_to_stdin(const char *input)
{
FILE *f = cr_get_redirected_stdin();
fputs(input, f);
fclose(f); // Make sure to send EOF when parsing
}