|
grim@394
|
1 |
/* |
|
grim@394
|
2 |
* Copyright (C) 2007-2010 Gary Kramlich <grim@reaperworld.com> |
|
grim@394
|
3 |
* |
|
grim@394
|
4 |
* This program is free software: you can redistribute it and/or modify |
|
grim@394
|
5 |
* it under the terms of the GNU General Public License as published by |
|
grim@394
|
6 |
* the Free Software Foundation, either version 3 of the License, or |
|
grim@394
|
7 |
* (at your option) any later version. |
|
grim@394
|
8 |
* |
|
grim@394
|
9 |
* This program is distributed in the hope that it will be useful, |
|
grim@394
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
grim@394
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
grim@394
|
12 |
* GNU General Public License for more details. |
|
grim@394
|
13 |
* |
|
grim@394
|
14 |
* You should have received a copy of the GNU General Public License |
|
grim@394
|
15 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
|
grim@394
|
16 |
*/ |
|
grim@386
|
17 |
#include <gplate/gplate.h> |
|
grim@386
|
18 |
|
|
grim@386
|
19 |
#include <glib.h> |
|
grim@386
|
20 |
|
|
grim@389
|
21 |
#include "gplate-tag-test.h" |
|
grim@386
|
22 |
|
|
grim@386
|
23 |
/****************************************************************************** |
|
grim@386
|
24 |
* Tests |
|
grim@386
|
25 |
*****************************************************************************/ |
|
grim@386
|
26 |
static void |
|
grim@389
|
27 |
gplate_text_tag_test_syntax_plain(GPlateTagTestFixture *fixture, |
|
grim@389
|
28 |
gconstpointer data) |
|
grim@386
|
29 |
{ |
|
grim@395
|
30 |
gplate_tag_test_output(fixture, data, |
|
grim@395
|
31 |
"simple template", "simple template"); |
|
grim@386
|
32 |
} |
|
grim@386
|
33 |
|
|
grim@387
|
34 |
static void |
|
grim@389
|
35 |
gplate_text_tag_test_syntax_keywords(GPlateTagTestFixture *fixture, |
|
grim@389
|
36 |
gconstpointer data) |
|
grim@387
|
37 |
{ |
|
grim@395
|
38 |
gplate_tag_test_output(fixture, data, |
|
grim@395
|
39 |
"extends if else endif for endfor", |
|
grim@395
|
40 |
"extends if else endif for endfor"); |
|
grim@387
|
41 |
} |
|
grim@387
|
42 |
|
|
grim@387
|
43 |
static void |
|
grim@389
|
44 |
gplate_text_tag_test_syntax_keywords_case_sensitive(GPlateTagTestFixture *fixture, |
|
grim@389
|
45 |
gconstpointer data) |
|
grim@387
|
46 |
{ |
|
grim@395
|
47 |
gplate_tag_test_output(fixture, data, |
|
grim@395
|
48 |
"EXteNds iF eLse enDif fOr enDFor", |
|
grim@395
|
49 |
"EXteNds iF eLse enDif fOr enDFor"); |
|
grim@387
|
50 |
} |
|
grim@387
|
51 |
|
|
grim@386
|
52 |
/****************************************************************************** |
|
grim@386
|
53 |
* Main |
|
grim@386
|
54 |
*****************************************************************************/ |
|
grim@386
|
55 |
gint |
|
grim@386
|
56 |
main(gint argc, gchar **argv) { |
|
grim@386
|
57 |
g_test_init(&argc, &argv, NULL); |
|
grim@386
|
58 |
|
|
grim@386
|
59 |
g_type_init(); |
|
grim@386
|
60 |
|
|
grim@386
|
61 |
gplate_config_load_default(); |
|
grim@386
|
62 |
|
|
grim@389
|
63 |
gplate_tag_test_add("/tags/text/plain", |
|
grim@389
|
64 |
gplate_text_tag_test_syntax_plain); |
|
grim@389
|
65 |
gplate_tag_test_add("/tags/text/keywords", |
|
grim@389
|
66 |
gplate_text_tag_test_syntax_keywords); |
|
grim@389
|
67 |
gplate_tag_test_add("/tags/text/keywords_case_sensitive", |
|
grim@389
|
68 |
gplate_text_tag_test_syntax_keywords_case_sensitive); |
|
grim@387
|
69 |
|
|
grim@386
|
70 |
return g_test_run(); |
|
grim@386
|
71 |
} |
|
grim@386
|
72 |
|