blob: 19811fd4a10a5cd3e24b09668260b38fd5530f5a [file] [log] [blame]
Bert Frees111e7022015-02-10 12:57:05 +01001#include <stdio.h>
2#include <string.h>
3#include <stdlib.h>
4#include <unistd.h>
Christian Eglib5bcac12015-08-19 11:16:09 +02005#include "liblouis.h"
Bert Frees111e7022015-02-10 12:57:05 +01006#include "louis.h"
7
8int
9main(int argc, char **argv)
10{
11 int success = 0;
12 char * match;
Bert Frees17a7ad12015-03-09 20:41:05 +010013 const char * tables[] = {"tablesWithMetadata/foo","tablesWithMetadata/bar",NULL};
Bert Frees111e7022015-02-10 12:57:05 +010014 lou_setLogLevel(LOG_DEBUG);
Bert Frees17a7ad12015-03-09 20:41:05 +010015 lou_indexTables(tables);
Bert Frees111e7022015-02-10 12:57:05 +010016 match = lou_findTable("id:foo");
Christian Egli2942c1b2015-05-29 14:11:11 +020017 success |= (!match || (strstr(match, "tablesWithMetadata/foo") == NULL));
Bert Frees111e7022015-02-10 12:57:05 +010018 match = lou_findTable("language:en");
Christian Egli2942c1b2015-05-29 14:11:11 +020019 success |= (!match || (strstr(match, "tablesWithMetadata/bar") == NULL));
Christian Eglib5bcac12015-08-19 11:16:09 +020020
21 lou_free();
Bert Frees111e7022015-02-10 12:57:05 +010022 return success;
23}