Author: jilles
Date: Sun Apr 19 13:46:13 2015
New Revision: 281742
URL: https://svnweb.freebsd.org/changeset/base/281742

Log:
  MFC r280830: wordexp(): Add testcase for non-default IFS in environment.
  
  The non-default IFS is expected to be used.

Modified:
  stable/10/tools/regression/lib/libc/gen/test-wordexp.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/tools/regression/lib/libc/gen/test-wordexp.c
==============================================================================
--- stable/10/tools/regression/lib/libc/gen/test-wordexp.c      Sun Apr 19 
13:28:32 2015        (r281741)
+++ stable/10/tools/regression/lib/libc/gen/test-wordexp.c      Sun Apr 19 
13:46:13 2015        (r281742)
@@ -240,6 +240,21 @@ main(int argc, char *argv[])
        r = unsetenv("IFS");
        assert(r == 0);
 
+       /*
+        * With IFS set to a non-default value, and using it.
+        */
+       r = setenv("IFS", ":", 1);
+       assert(r == 0);
+       r = wordexp("${IFS+hello:world}", &we, 0);
+       assert(r == 0);
+       assert(we.we_wordc == 2);
+       assert(strcmp(we.we_wordv[0], "hello") == 0);
+       assert(strcmp(we.we_wordv[1], "world") == 0);
+       assert(we.we_wordv[2] == NULL);
+       wordfree(&we);
+       r = unsetenv("IFS");
+       assert(r == 0);
+
        printf("PASS wordexp()\n");
        printf("PASS wordfree()\n");
 
_______________________________________________
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"

Reply via email to