use --WORLD as root of all actions (GC just deletes --WORLD)
[mala.git] / tests / test-mala_expansions.c
blob6ef3d7b3f36bb67183f0170d0cb304f01ab6be72
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"
23 #include "std.h"
25 int
26 main(int argc, char * argv[])
28 MalaEngine my_engine;
29 //MalaStringListNode pptr;
31 (void) argc;
32 (void) argv;
34 my_engine = mala_engine_new ();
35 mala_module_std_init (my_engine);
36 mala_engine_ppexpand_define (my_engine, "--COMMANDLINE", argc - 1, argv + 1);
37 mala_engine_pushback_word (my_engine, "--COMMANDLINE");
39 mala_engine_step (my_engine);
40 //pptr = mala_stringlist_head ( mala_engine_getprogram (my_engine));
41 //mala_engine_arg_eval (my_engine, &pptr, 0, 1, NULL);
43 mala_engine_dumpargs (my_engine, stdout, "arg: ", "\n");
44 mala_engine_dumpprogram (my_engine, stdout, "prg: ", "\n");
46 printf ("variable: %s\n", getenv ("variable"));
47 printf ("negated: %d\n", mala_engine_negated (my_engine));
48 printf ("state: %s\n", mala_engine_state_str (my_engine));
50 mala_engine_free (my_engine);
51 return 0;
57 // Local Variables:
58 // mode: C
59 // c-file-style: "gnu"
60 // End:
61 // arch-tag: 2ce6015a-6da8-4ad9-ab3c-602347445b93
62 // end_of_file