00_basic.t

来自「这是一个关于c-cluster的技术文章,它详细地介绍了cluster的一些技术」· T 代码 · 共 54 行

T
54
字号
my ($last_test,$loaded);######################### We start with some black magic to print on failure.use lib '../blib/lib','../blib/arch';BEGIN { $last_test = 2; $| = 1; print "1..$last_test\n"; }END   { print "not ok 1  Can't load Algorithm::Cluster\n" unless $loaded; }use Algorithm::Cluster;$loaded = 1;print "ok 1\n";######################### End of black magic.sub test;  # Predeclare the test function (defined below)my $tcounter = 1;my $want     = '';#------------------------------------------------------# Tests# my $xx = Algorithm::Cluster::hello();$want = "Hello world!!\n";            test q( $xx  );#------------------------------------------------------# Test function# sub test {	$tcounter++;	my $string = shift;	my $ret = eval $string;	$ret = 'undef' if not defined $ret;	if("$ret" =~ /^$want$/sm) {		print "ok $tcounter\n";	} else {		print "not ok $tcounter\n",		"   -- '$string' returned '$ret'\n", 		"   -- expected =~ /$want/\n"	}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?