view run/dup_01.d @ 4:1ed6616fe905

extended array tests
author thomask
date Sun, 26 Sep 2004 15:54:31 +0000
parents
children f87ba6507260
line wrap: on
line source

int main(){
	byte[] a;
	a.length=3;
	a[0]=3;
	a[1]=9;
	a[2]=18;

	byte[] b= a.dup;
	a[2]='A';
	b[0]='B';

	assert(a.length==3);
	assert(a[0]==3);
	assert(a[1]==9);
	assert(a[2]=='A');

	assert(b.length==3);
	assert(b[0]=='B');
	assert(b[1]==9);
	assert(b[2]==18);

	return 0;
}