diff options
Diffstat (limited to 'tests/pushck.c')
-rw-r--r-- | tests/pushck.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/pushck.c b/tests/pushck.c new file mode 100644 index 0000000..f94cbf7 --- /dev/null +++ b/tests/pushck.c @@ -0,0 +1,34 @@ +#include <config.h> +#include <wydawca.h> + +static void +printcwd (int c) +{ + char *dir = getcwd_alloc (); + printf ("%c%s\n", c, dir); + free (dir); +} + +int +main (int argc, char **argv) +{ + while (--argc) + { + char *dir = *++argv; + if (push_dir (dir)) + { + perror (dir); + abort (); + } + printcwd ('+'); + } + + do + { + printcwd ('-'); + } + while (pop_dir() == 0); + exit(0); +} + + /*===============*/ |