underscore expansion
[mala.git] / tests / test-mala_stdmodule.c
blob9590a1e59628423cb754705c6d2cd08e4e9544b7
1 /*
2 test-mala_stdmodule.c - MaLa stdandard module test suite
4 Copyright (C) 2004, Christian Thaeter <chth@gmx.net>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License version 2 as
8 published by the Free Software Foundation.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, contact me.
19 #include <assert.h>
20 #include <stdio.h>
21 #include <stdlib.h>
22 #include "mala.h"
24 #define MALA_SUBSTITUTE_PARSER(a,b) {a,mala_substitute_parser,NULL,b,NULL,NULL}
26 mala_actioninit my_actions[] =
28 MALA_SUBSTITUTE_PARSER("--FLAG-NUMSPLIT-EXPANSION","--TRUE"),
29 MALA_SUBSTITUTE_PARSER("--FLAG-EXCLAM-EXPANSION","--TRUE"),
30 MALA_SUBSTITUTE_PARSER("--FLAG-NO-EXPANSION","--TRUE"),
31 MALA_SUBSTITUTE_PARSER("--FLAG-ASSIGN-EXPANSION","--TRUE"),
32 MALA_SUBSTITUTE_PARSER("--FLAG-ENVVAR-EXPANSION","--TRUE"),
33 MALA_SUBSTITUTE_PARSER("--FLAG-CHAR-EXPANSION","--TRUE"),
34 MALA_SUBSTITUTE_PARSER("--FLAG-UNDERSCORE-EXPANSION","--TRUE"),
35 //MALA_SUBSTITUTE_PARSER("--FLAG-NUMSPLIT-EXPANSION","--TRUE"),
36 //MALA_SUBSTITUTE_PARSER("--FLAG-NUMSPLIT-EXPANSION","--TRUE"),
38 "TWO",
39 //NULL,
40 mala_substitute_parser,
41 NULL,
42 "USERDATA",
43 "brief",
44 (const char*[]){"help",NULL},
47 "TWO",
48 //NULL,
49 mala_substitute_parser,
50 NULL,
51 "USERDATA",
52 "brief",
53 (const char*[]){"help",NULL},
55 MALA_ACTIONS_END
58 int
59 main(int argc, char * argv[])
61 MalaEngine my_engine;
62 my_engine = mala_engine_new_main (0, argc, argv, my_actions);
64 #if 0 /*TODO*/
65 my_engine = mala_engine_new_main (mala_stdmodule_init, argc, argv, 0);
66 #endif
68 mala_engine_run (my_engine);
70 mala_engine_dumpargs (my_engine, "arg: ", "\n");
71 mala_engine_dumpprogram (my_engine, "prg: ", "\n");
73 printf ("variable: %s\n", getenv ("variable"));
74 printf ("negated: %d\n", mala_engine_negated (my_engine));
75 printf ("state: %d\n", mala_engine_state_get (my_engine));
77 MALA_DEBUG("freeing engine");
78 mala_engine_free (my_engine);
79 return 0;
85 // Local Variables:
86 // mode: C
87 // c-file-style: "gnu"
88 // End:
89 // arch-tag: 56bcc0c2-d247-4a47-95dc-a460f26a444b
90 // end_of_file