blob: ceb9e9ef3ea852811fc138e6d261037eedf8a885 [file] [log] [blame]
Christian Eglib6698722016-12-01 12:24:18 +01001/* liblouis Braille Translation and Back-Translation Library
2
3Copyright (C) 2015 Bert Frees <bertfrees@gmail.com>
4
5Copying and distribution of this file, with or without modification,
6are permitted in any medium without royalty provided the copyright
7notice and this notice are preserved. This file is offered as-is,
8without any warranty. */
9
Christian Egli26fabec2015-09-11 16:28:40 +020010#include <config.h>
Bert Frees111e7022015-02-10 12:57:05 +010011#include <stdio.h>
12#include <string.h>
13#include <stdlib.h>
14#include <unistd.h>
Christian Eglib5bcac12015-08-19 11:16:09 +020015#include "liblouis.h"
Bert Frees111e7022015-02-10 12:57:05 +010016#include "louis.h"
17
18int
19main(int argc, char **argv)
20{
21 int success = 0;
22 char * match;
Christian Egli95539602016-10-06 17:26:42 +020023 const char * tables[] = {"tests/tablesWithMetadata/foo","tests/tablesWithMetadata/bar",NULL};
Bert Frees111e7022015-02-10 12:57:05 +010024 lou_setLogLevel(LOG_DEBUG);
Bert Frees17a7ad12015-03-09 20:41:05 +010025 lou_indexTables(tables);
Bert Frees111e7022015-02-10 12:57:05 +010026 match = lou_findTable("id:foo");
Christian Egli2942c1b2015-05-29 14:11:11 +020027 success |= (!match || (strstr(match, "tablesWithMetadata/foo") == NULL));
Bert Frees111e7022015-02-10 12:57:05 +010028 match = lou_findTable("language:en");
Christian Egli2942c1b2015-05-29 14:11:11 +020029 success |= (!match || (strstr(match, "tablesWithMetadata/bar") == NULL));
Christian Eglib5bcac12015-08-19 11:16:09 +020030
31 lou_free();
Bert Frees111e7022015-02-10 12:57:05 +010032 return success;
33}