1 #include "test.h"
2
3 #include "../../src/int/file_magic.h"
4 #include "../../src/utils/matchers.h"
5 #include "../../src/filetype.h"
6
7 void
set_programs(const char pattern[],const char programs[],int for_x,int in_x)8 set_programs(const char pattern[], const char programs[], int for_x, int in_x)
9 {
10 char *error;
11 matchers_t *ms;
12
13 assert_non_null(ms = matchers_alloc(pattern, 0, 1, "", &error));
14 assert_null(error);
15
16 ft_set_programs(ms, programs, for_x, in_x);
17 }
18
19 void
set_viewers(const char pattern[],const char viewers[])20 set_viewers(const char pattern[], const char viewers[])
21 {
22 char *error;
23 matchers_t *ms;
24
25 assert_non_null(ms = matchers_alloc(pattern, 0, 1, "", &error));
26 assert_null(error);
27
28 ft_set_viewers(ms, viewers);
29 }
30
31 int
has_mime_type_detection(void)32 has_mime_type_detection(void)
33 {
34 return get_mimetype(TEST_DATA_PATH "/read/dos-line-endings", 0) != NULL;
35 }
36
37 /* vim: set tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab cinoptions-=(0 : */
38 /* vim: set cinoptions+=t0 filetype=c : */
39