Christian Egli | 26fabec | 2015-09-11 16:28:40 +0200 | [diff] [blame] | 1 | #include <config.h> |
Bert Frees | 111e702 | 2015-02-10 12:57:05 +0100 | [diff] [blame] | 2 | #include <stdio.h> |
| 3 | #include <string.h> |
| 4 | #include <stdlib.h> |
| 5 | #include <unistd.h> |
Christian Egli | b5bcac1 | 2015-08-19 11:16:09 +0200 | [diff] [blame] | 6 | #include "liblouis.h" |
Bert Frees | 111e702 | 2015-02-10 12:57:05 +0100 | [diff] [blame] | 7 | #include "louis.h" |
| 8 | |
| 9 | int |
| 10 | main(int argc, char **argv) |
| 11 | { |
| 12 | int success = 0; |
| 13 | char * match; |
Christian Egli | 9553960 | 2016-10-06 17:26:42 +0200 | [diff] [blame] | 14 | const char * tables[] = {"tests/tablesWithMetadata/foo","tests/tablesWithMetadata/bar",NULL}; |
Bert Frees | 111e702 | 2015-02-10 12:57:05 +0100 | [diff] [blame] | 15 | lou_setLogLevel(LOG_DEBUG); |
Bert Frees | 17a7ad1 | 2015-03-09 20:41:05 +0100 | [diff] [blame] | 16 | lou_indexTables(tables); |
Bert Frees | 111e702 | 2015-02-10 12:57:05 +0100 | [diff] [blame] | 17 | match = lou_findTable("id:foo"); |
Christian Egli | 2942c1b | 2015-05-29 14:11:11 +0200 | [diff] [blame] | 18 | success |= (!match || (strstr(match, "tablesWithMetadata/foo") == NULL)); |
Bert Frees | 111e702 | 2015-02-10 12:57:05 +0100 | [diff] [blame] | 19 | match = lou_findTable("language:en"); |
Christian Egli | 2942c1b | 2015-05-29 14:11:11 +0200 | [diff] [blame] | 20 | success |= (!match || (strstr(match, "tablesWithMetadata/bar") == NULL)); |
Christian Egli | b5bcac1 | 2015-08-19 11:16:09 +0200 | [diff] [blame] | 21 | |
| 22 | lou_free(); |
Bert Frees | 111e702 | 2015-02-10 12:57:05 +0100 | [diff] [blame] | 23 | return success; |
| 24 | } |