pike.git / src / testsuite.in

version» Context lines:

pike.git/src/testsuite.in:8844:    array a = indices (allocate (7));    Array.Iterator i = get_iterator (a);    foreach (i;; int v)    if (v > 3) break;    foreach (i;; int v)    if (v < 5) break;    foreach (i;; int v)    return v;   ]], 4)    + test_any([[ +  // Check foreach with negative ranges [bug 7216]/[LysLysKOM 20892964]. +  array a = ({ -2, -1, 0, 1, 2 }); +  int total; +  foreach(a, int start) { +  foreach(a[start..], int val) { +  if (!intp(val)) error("Invalid svalue!\n"); +  total += (val + 3)*(start + 3); +  } +  } +  return total; + ]], 15 + 30 + 45 + 56 + 60) +    // do-while   test_any(int e;string t=""; e=0; do{ t+=e; }while(++e<6); return t,"012345";)      // while   test_any(int e;string t=""; e=8; while(--e) t+=e; return t,"7654321";)   test_any(int e;string t=""; e=8; while(e--) t+=e; return t,"76543210";)   test_any(int e;string t=""; e=0; while(++e<6) t+=e; return t,"12345";)   test_any(int e=1;string t=""; while(e<20){t+=e;e*=2;} return t,"124816";)      // Switch