--- var_test.c 2001/12/14 13:49:40 1.27
+++ var_test.c 2001/12/16 23:40:16 1.28
@@ -65,7 +65,7 @@
printf("Found variable at index %d.\n", i);
counter = 1;
length = strlen(vars[i].data);
- while ( vars[i + counter].data
+ while ( vars[i + counter].data
&& strncmp(varname, vars[i + counter].name, name_len) == 0)
counter++;
if (counter == 1)
@@ -134,7 +134,7 @@
{ "${HOME:s/[esO]/_/gi}", "/h_m_/r_gr___i_n-t__t_" },
{ "${OSTYPE:s/^[re]/_/g}", "_egression-os" },
{ "${EMPTY:s/^[re]/_/g}", "" },
- { "${HOME:s/.*/heinz/}", "heinz" },
+ { "${HOME:s/.*\\x{}/heinz/}", "heinz" },
{ "${HOME:s/e/bla/t}", "/hombla/regression-tests" },
{ "${HOME:s/E/bla/t}", "/home/regression-tests" },
{ "${HOME:s/E/bla/ti}", "/hombla/regression-tests" },
@@ -173,6 +173,8 @@
{ "${ARRAY[5/(${UNDEFINED})]}", "${ARRAY[5/(${UNDEFINED})]}" },
{ "[${ARRAY[#]}-]", "entry0-entry1-entry2-entry3-" },
{ "[${ARRAY[#+1]}-]", "entry1-entry2-entry3-" },
+ { "-[${ARRAY[#]}:]{1,$NUMBER}-", "-entry1:entry2:-" },
+ { "-[${ARRAY[#]}:]{1,3,5}-", "-entry1::-" },
{
"[${ARRAY}:${ARRAY[#]}-]",
"entry0:entry0-entry0:entry1-entry0:entry2-entry0:entry3-"
@@ -188,7 +190,11 @@
{
"[${HEINZ[#]}: [${ARRAY[#]}${ARRAY[#+1]:+, }]${HEINZ[#+1]:+; }]",
"heinz0: entry0, entry1, entry2, entry3; heinz1: entry0, entry1, entry2, entry3"
- }
+ },
+ {
+ "[${ARRAY[#]}:[${ARRAY[#]},]{1,2,} ]{0,2,}",
+ "entry0:entry1,entry3, entry2:entry1,entry3, "
+ },
};
char *tmp;
size_t tmp_len;
@@ -220,7 +226,7 @@
#ifdef DEBUG
printf("Test case #%02d: Expanded output is '%s'.\n", i, tmp);
#endif
- if ( tmp_len != strlen(tests[i].expected)
+ if ( tmp_len != strlen(tests[i].expected)
|| tmp == NULL
|| memcmp(tests[i].expected, tmp, tmp_len) != 0) {
printf("Test case #%d: Expected result '%s' but got '%s'.\n",
|