Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > fff2921ff40d1f832561027dc17323f5 > files > 51

epic5-1.1.9-3.mga5.i586.rpm

coredump
on yell -
set lastlog 100000

alias test (array, rest) {
	@:foo=jot(0 ${numitems($array)-1})
	if (foo!=itemtoindex($array $indextoitem($array $foo))) {
		echo $array $numitems($array) failed itemof(indexof()) test: $array $rest
	} elsif (foo!=indextoitem($array $itemtoindex($array $foo))) {
		echo $array $numitems($array) failed indexof(itemof()) test: $array $rest
	} elsif (sort($getitem($array $foo))!=sort($igetitem($array $foo))) {
		echo $array $numitems($array) failed index consistancy test: $array $rest
	} else {echo OK: $array $rest}
}

fe (baz bar foo) qwer {
	@delarray($qwer)
	fe (4 49 499 4999) zxcv {
		fe (2 0 2) fnord {
			@ :asdf = numitems($qwer) / 2
			@ igetitem($qwer 0)
			for foo from $asdf to $zxcv {@setitem($qwer $foo $rand($fnord))}
			repeat $asdf {@delitems($qwer $rand($numitems($qwer)))}
			test $qwer A: $asdf $zxcv $fnord
			for foo from $asdf to $zxcv {@usetitem($qwer $foo $rand($fnord))}
			repeat $asdf {@delitems($qwer $rand($numitems($qwer)))}
			test $qwer B: $asdf $zxcv $fnord
		}
	}
}

if (getarrays()!=sort($uniq($getarrays()))) {
	echo Array list destroyed: $getarrays()
} elsif (3>numwords($getarrays())) {
	echo Too few arrays: $getarrays()
} elsif (3<numwords($getarrays())) {
	echo Too many arrays: $getarrays()
	echo Maybe some were already set?
} else {
	echo Array list OK.
}