-if (@ARGV)
- {
- $test_end = $test_start = shift;
- $test_end = shift if @ARGV;
- $test_end = ($test_start >= 9000)? TEST_SPECIAL_TOP : TEST_TOP
- if $test_end eq '+';
- die "** Test numbers out of order\n" if ($test_end < $test_start);
- }
+my @wanted = sort numerically uniq
+ @tests_wanted ? @tests_wanted : (),
+ @range_wanted ? $range_wanted[0] .. $range_wanted[1] : (),
+ @ARGV ? @ARGV == 1 ? $ARGV[0] :
+ $ARGV[1] eq '+' ? $ARGV[0]..($ARGV[0] >= 9000 ? TEST_SPECIAL_TOP : TEST_TOP) :
+ 0+$ARGV[0]..0+$ARGV[1] # add 0 to cope with test numbers starting with zero
+ : ();
+@wanted = 1..TEST_TOP if not @wanted;