Mercurial > projects > dstress
view run/foreach_13.d @ 1626:e160bfec54d5
add test
author | Moritz Warning <moritzwarning@web.de> |
---|---|
date | Thu, 06 Jan 2011 15:52:55 +0100 |
parents | 20d8ee6523e1 |
children |
line wrap: on
line source
// $HeadURL$ // $Date$ // $Author$ module dstress.run.foreach_13; int main(){ char[] array="abc".dup; int count=0; assert(count==0); assert(array[0]=='a'); assert(array[1]=='b'); assert(array[2]=='c'); foreach(ref char value; array){ count++; value++; } assert(count==3); assert(array[0]=='b'); assert(array[1]=='c'); assert(array[2]=='d'); return 0; }