view run/default_argument_08.d @ 1597:8b9d4d2f925a

Fix typos in complex tests. See D bug 614.
author Christian Kamm <kamm incasoftware de>
date Tue, 09 Sep 2008 16:53:58 +0200
parents 36bedfa079e6
children
line wrap: on
line source

// $HeadURL$
// $Date$
// $Author$

// @author@	Lars Ivar Igesund <larsivar@igesund.net>	
// @date@	2005-04-09
// @uri@	http://www.digitalmars.com/pnews/read.php?server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=3596

module dstress.run.default_argument_08;

int foo(string x = BAR){
	return x.length;
}

string BAR = "Bar";

int main(){
	if(3 != foo()){
		assert(0);
	}
	if(1 != foo("a")){
		assert(0);
	}
	if(3 != foo){
		assert(0);
	}
	BAR="ab";
	if(2 != foo()){
		assert(0);
	}
	return 0;
}