blob: c7bc38c93d3d6d91a4023974359cd56ca12b7e33 [file] [log] [blame]
Christian Egli26fabec2015-09-11 16:28:40 +02001#include <config.h>
Bert Frees111e7022015-02-10 12:57:05 +01002#include <stdio.h>
3#include <string.h>
4#include <stdlib.h>
5#include <unistd.h>
Christian Eglib5bcac12015-08-19 11:16:09 +02006#include "liblouis.h"
Bert Frees111e7022015-02-10 12:57:05 +01007#include "louis.h"
8
9int
10main(int argc, char **argv)
11{
12 int success = 0;
13 char * match;
Christian Egli95539602016-10-06 17:26:42 +020014 const char * tables[] = {"tests/tablesWithMetadata/foo","tests/tablesWithMetadata/bar",NULL};
Bert Frees111e7022015-02-10 12:57:05 +010015 lou_setLogLevel(LOG_DEBUG);
Bert Frees17a7ad12015-03-09 20:41:05 +010016 lou_indexTables(tables);
Bert Frees111e7022015-02-10 12:57:05 +010017 match = lou_findTable("id:foo");
Christian Egli2942c1b2015-05-29 14:11:11 +020018 success |= (!match || (strstr(match, "tablesWithMetadata/foo") == NULL));
Bert Frees111e7022015-02-10 12:57:05 +010019 match = lou_findTable("language:en");
Christian Egli2942c1b2015-05-29 14:11:11 +020020 success |= (!match || (strstr(match, "tablesWithMetadata/bar") == NULL));
Christian Eglib5bcac12015-08-19 11:16:09 +020021
22 lou_free();
Bert Frees111e7022015-02-10 12:57:05 +010023 return success;
24}