diff options
Diffstat (limited to 'src/test-env-replace.c')
-rw-r--r-- | src/test-env-replace.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/test-env-replace.c b/src/test-env-replace.c index 37dd7ff590..4188c67dde 100644 --- a/src/test-env-replace.c +++ b/src/test-env-replace.c @@ -47,7 +47,7 @@ int main(int argc, char *argv[]) { NULL }; - char **i, **r, *t; + char **i, **r, *t, **a, **b; r = replace_env_argv((char**) line, (char**) env); @@ -96,5 +96,24 @@ int main(int argc, char *argv[]) { printf("%s\n", t); free(t); + a = strv_new("FOO=BAR", "WALDO=WALDO", "WALDO=", "PIEP", "SCHLUMPF=SMURF", NULL); + b = strv_new("FOO=KKK", "FOO=", "PIEP=", "SCHLUMPF=SMURFF", "NANANANA=YES", NULL); + + r = strv_env_merge(2, a, b); + strv_free(a); + strv_free(b); + + STRV_FOREACH(i, r) + printf("%s\n", *i); + + printf("CLEANED UP:\n"); + + r = strv_env_clean(r); + + STRV_FOREACH(i, r) + printf("%s\n", *i); + + strv_free(r); + return 0; } |