Christian Egli | b669872 | 2016-12-01 12:24:18 +0100 | [diff] [blame] | 1 | /* liblouis Braille Translation and Back-Translation Library |
| 2 | |
| 3 | Copyright (C) 2015 Bert Frees <bertfrees@gmail.com> |
| 4 | |
| 5 | Copying and distribution of this file, with or without modification, |
| 6 | are permitted in any medium without royalty provided the copyright |
| 7 | notice and this notice are preserved. This file is offered as-is, |
| 8 | without any warranty. */ |
| 9 | |
Christian Egli | 26fabec | 2015-09-11 16:28:40 +0200 | [diff] [blame] | 10 | #include <config.h> |
Bert Frees | 111e702 | 2015-02-10 12:57:05 +0100 | [diff] [blame] | 11 | #include <stdio.h> |
| 12 | #include <string.h> |
| 13 | #include <stdlib.h> |
| 14 | #include <unistd.h> |
Christian Egli | b5bcac1 | 2015-08-19 11:16:09 +0200 | [diff] [blame] | 15 | #include "liblouis.h" |
Davy Kager | ff52a4f | 2017-04-26 22:01:10 +0200 | [diff] [blame] | 16 | #include "internal.h" |
Bert Frees | 111e702 | 2015-02-10 12:57:05 +0100 | [diff] [blame] | 17 | |
| 18 | int |
| 19 | main(int argc, char **argv) |
| 20 | { |
| 21 | int success = 0; |
| 22 | char * match; |
Bert Frees | 84f9dbf | 2017-11-12 22:38:01 +0100 | [diff] [blame] | 23 | char ** matches; |
Christian Egli | 9553960 | 2016-10-06 17:26:42 +0200 | [diff] [blame] | 24 | const char * tables[] = {"tests/tablesWithMetadata/foo","tests/tablesWithMetadata/bar",NULL}; |
Christian Egli | 547815d | 2019-03-04 09:46:51 +0100 | [diff] [blame] | 25 | lou_setLogLevel(LOU_LOG_DEBUG); |
Bert Frees | 17a7ad1 | 2015-03-09 20:41:05 +0100 | [diff] [blame] | 26 | lou_indexTables(tables); |
Bert Frees | 111e702 | 2015-02-10 12:57:05 +0100 | [diff] [blame] | 27 | match = lou_findTable("id:foo"); |
Christian Egli | 2942c1b | 2015-05-29 14:11:11 +0200 | [diff] [blame] | 28 | success |= (!match || (strstr(match, "tablesWithMetadata/foo") == NULL)); |
Bert Frees | 111e702 | 2015-02-10 12:57:05 +0100 | [diff] [blame] | 29 | match = lou_findTable("language:en"); |
Christian Egli | 2942c1b | 2015-05-29 14:11:11 +0200 | [diff] [blame] | 30 | success |= (!match || (strstr(match, "tablesWithMetadata/bar") == NULL)); |
Bert Frees | 84f9dbf | 2017-11-12 22:38:01 +0100 | [diff] [blame] | 31 | matches = lou_findTables("language:en"); |
| 32 | success |= (!matches || !matches[0] || (strstr(matches[0], "tablesWithMetadata/bar") == NULL)); |
| 33 | success |= (!matches || !matches[0] || !matches[1] || (strstr(matches[1], "tablesWithMetadata/foo") == NULL)); |
Christian Egli | b5bcac1 | 2015-08-19 11:16:09 +0200 | [diff] [blame] | 34 | lou_free(); |
Bert Frees | 111e702 | 2015-02-10 12:57:05 +0100 | [diff] [blame] | 35 | return success; |
| 36 | } |