PennMUSH Community

Changeset 1078

Show
Ignore:
Timestamp:
08/23/07 23:53:33 (1 year ago)
Author:
shawnw
Message:

#7443: regression test rewrite

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 1.8.3/branches/devel/CHANGES.183

    r1074 r1078  
    2020 * Significant rewrite of ansi parsing and better ansi support 
    2121   for many string-handling functions. Patch by Sketch. 
     22 * Rewrite of the softcode regression testing framework, and  
     23   addition of more tests. [SW] 
    2224 
    2325Minor changes: 
  • 1.8.3/branches/devel/MANIFEST

    r998 r1078  
    234234src/wild.c 
    235235src/wiz.c 
     236test/README 
    236237test/MUSHConnection.pm 
    237238test/PennMUSH.pm 
    238239test/TestHarness.pm 
    239 test/alltests.pl 
     240test/alltests.sh.in 
     241test/runtest.pl 
    240242test/testalias.pl 
    241243test/testatree.pl 
     
    257259test/teststringsecs.pl 
    258260test/testtr.pl 
     261test/testtrim.pl 
    259262utils/clwrapper.sh 
    260263utils/customize.pl 
  • 1.8.3/branches/devel/configure

    r1017 r1078  
    1794417944ac_config_files="$ac_config_files game/txt/compose.sh" 
    1794517945 
     17946ac_config_files="$ac_config_files test/alltests.sh" 
     17947 
    1794617948cat >confcache <<\_ACEOF 
    1794717949# This file is a shell script that caches the results of configure 
     
    1848818490    "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; 
    1848918491    "game/txt/compose.sh") CONFIG_FILES="$CONFIG_FILES game/txt/compose.sh" ;; 
     18492    "test/alltests.sh") CONFIG_FILES="$CONFIG_FILES test/alltests.sh" ;; 
    1849018493 
    1849118494  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 
     
    1903419037  case $ac_file$ac_mode in 
    1903519038    "game/txt/compose.sh":F) chmod +x game/txt/compose.sh ;; 
     19039    "test/alltests.sh":F) chmod +x test/alltests.sh ;; 
    1903619040 
    1903719041  esac 
  • 1.8.3/branches/devel/configure.in

    r1017 r1078  
    288288AC_CONFIG_FILES([Makefile src/Makefile]) 
    289289AC_CONFIG_FILES([game/txt/compose.sh], [chmod +x game/txt/compose.sh]) 
     290AC_CONFIG_FILES([test/alltests.sh], [chmod +x test/alltests.sh]) 
    290291AC_OUTPUT 
  • 1.8.3/branches/devel/test/TestHarness.pm

    r439 r1078  
    11package TestHarness; 
     2use strict; 
     3use vars qw/%tests $testcount @failures $alltests $allfailures $allexpected/; 
     4use vars qw/$testfiles $use_mortal/; 
     5use subs qw/test summary/; 
    26 
    3 require Exporter; 
     7$alltests = 0; 
     8$allfailures = 0; 
     9$allexpected = 0; 
     10$testfiles = 0; 
     11$use_mortal = 0; 
    412 
    5 @ISA = qw(Exporter); 
     13sub new { 
     14    my $class = shift; 
     15    my $script = shift; 
     16    my %self = (  
     17        -expected => 0, 
     18        -depends => [], 
     19        -test => undef, 
     20    ); 
     21#    print "Looking at $script\n"; 
     22    $script =~ /^test(.*)\.pl$/o; 
     23    my $name = $1; 
     24    $self{-name} = $name; 
     25    warn "Duplicate test $name\n" if exists $tests{$name}; 
     26    my $code = 'sub { my $god = shift; ' . "\n"; 
     27    open IN, "<", $script or die "Couldn't open ${script}: $!\n"; 
     28    while (<IN>) { 
     29        chomp; 
     30        next if /^\s*(?:#|$)/o; 
     31        last if /^run tests:$/o; 
     32        if (/^depends on (.*)$/o) { 
     33            push @{$self{-depends}}, $1; 
     34        } 
     35        if (/^expect (\d+) failures!$/) { 
     36            $self{-expected} = $1; 
     37            print "Expecting $1 failures in $name\n"; 
     38        } 
     39        if (/^\s*login mortal$/) { 
     40            $code .= 'my $mortal = shift;' . "\n"; 
     41            $use_mortal = 1; 
     42        } 
     43    } 
     44    while (<IN>) { 
     45        $code .= $_; 
     46    } 
     47    close IN; 
     48    $code .= "}"; 
     49#    print "Test function for $name:\n$code\n"; 
     50    $self{-test} = eval $code; 
     51    my $obj = bless \%self; 
     52    $tests{$name} = $obj; 
     53    return $obj; 
     54
    655 
    7 @EXPORT = qw(test summary); 
     56sub run { 
     57    my $self = shift; 
     58    my $god = shift; 
     59    my $mortal = shift; 
     60    my ($failures, $test) = (0,0); 
    861 
    9 my $testcount = 0; 
    10 my @failures = (); 
     62    foreach my $dep (@{$self->{-depends}}) { 
     63        my $test = $tests{$dep}; 
     64        if (defined $test) { 
     65            $test->run($god, $mortal); 
     66        } else { 
     67            warn "Unresolved dependency $dep\n"; 
     68        } 
     69    } 
     70     
     71    local ($testcount, @failures) = (0, ()); 
     72 
     73    my $name = $self->{-name}; 
     74 
     75    print "Running tests for ${name}:\n"; 
     76 
     77    &{$self->{-test}}($god, $mortal); 
     78 
     79    $testfiles++; 
     80    $alltests += $testcount; 
     81    $allfailures += @failures; 
     82    $allexpected += $self->{-expected}; 
     83     
     84    summary $self->{-name}, $testcount, \@failures, $self->{-expected}; 
     85
     86 
     87END { 
     88    print "Totals:\n"; 
     89    summary("all tests run", $alltests, $allfailures, $allexpected) 
     90        if $testfiles > 1; 
     91
    1192 
    1293$| = 1; 
     
    25106  my $verdict = 1; 
    26107 
    27   my $pattern; 
    28   foreach $pattern (@$patterns) { 
     108  foreach my $pattern (@$patterns) { 
    29109    my $matchpattern = $pattern; 
    30110    my $negate = 0; 
     
    57137      print "  result:  $result\n"; 
    58138    } 
    59     foreach $pattern (@$patterns) { 
     139    foreach my $pattern (@$patterns) { 
    60140      print "  pattern: $pattern\n"; 
    61141    } 
     
    65145 
    66146sub summary { 
    67   print ":"x70, "\n"; 
    68   print "\n"; 
    69   my $scount = $testcount - @failures; 
    70   my $fcount = @failures; 
    71   print "$testcount tests, $scount succeeded, $fcount failed\n"; 
    72   if ($fcount) { 
    73     print "failed tests:\n"; 
    74     my $str = join(", ", @failures); 
    75     while (length($str) > 67) { 
    76       $str =~ s/^(.{1,67}), //o; 
    77       print "  $1,\n"; 
     147    my ($name, $testcount, $failures, $expected) = @_; 
     148    print ":"x70, "\n"; 
     149    print "\n"; 
     150    my $fcount = 0; 
     151    if (ref $failures) { 
     152        $fcount = scalar @$failures; 
     153    } else { 
     154        $fcount = $failures; 
    78155    } 
    79     print "  $str\n"; 
    80   } 
    81  
    82   $testcount = 0; 
    83   @failures = (); 
    84 
    85  
    86 END { 
    87   summary() if $testcount; 
     156    my $scount = $testcount - $fcount; 
     157    print "$testcount tests, $scount succeeded, $fcount failed ($expected expected failures)\n"; 
     158    if ($fcount != $expected) { 
     159        print "failed tests:\n"; 
     160        my $str = join(", ", @$failures); 
     161        while (length($str) > 67) { 
     162            $str =~ s/^(.{1,67}), //o; 
     163            print "  $1,\n"; 
     164        } 
     165        print "  $str\n"; 
     166    } 
     167    print "\n"; 
    88168} 
    89169 
  • 1.8.3/branches/devel/test/testalias.pl

    r523 r1078  
    1 use PennMUSH; 
    2 use MUSHConnection; 
    3 use TestHarness; 
    4  
    5 $mush = PennMUSH->new(); 
    6 $god = $mush->loginGod(); 
    7  
     1run tests: 
    82test('alias.1', $god, '@name me=God', ['Name set.']); 
    93test('alias.2', $god, '@name me=One', ['Name set.']); 
  • 1.8.3/branches/devel/test/testatree.pl

    r463 r1078  
    1 use PennMUSH; 
    2 use MUSHConnection; 
    3 use TestHarness; 
    4  
    5 $| = 1; 
    6  
    7 $mush = PennMUSH->new(); 
    8 # print "MUSH on port ".$mush->{PORT}."\n"; 
    9 # sleep(30); 
    10 $god = $mush->loginGod(); 
    11  
     1login mortal 
     2run tests: 
    123# First, the basic tests enforcing tree-nature of the attributes. 
    134# Attrs may not start or end in ` 
     
    9283# Permissions checks 
    9384# Need a mortal for this... 
    94 test('atree.perms.1', $god, '@pcreate Mortal=mortal', 'created'); 
    95 $mortal = $mush->login("Mortal", "mortal"); 
    9685# Build a tree from different places... 
    9786test('atree.perms.2', $god, '&foo mortal=baz', 'Set'); 
  • 1.8.3/branches/devel/test/testdecompose.pl

    r1068 r1078  
    1 use PennMUSH; 
    2 use MUSHConnection; 
    3 use TestHarness; 
    4  
    5 $mush = PennMUSH->new(); 
    6 $god = $mush->loginGod(); 
    7  
    8 test('decompose.1', $god, 'think decompose([ansi(hr,b[ansi(f,la)]h)])', '\[ansi\(hr,b(\)\])?\[ansi\((?(1)fhr|f),la\)\](?(1)\[ansi\(hr,h|h)\)\]'); 
    9 test('decompose.2', $god, 'think decompose(a\ \ \ \ b)', 'a %b %bb'); 
    10 test('decompose.3', $god, 'think decompose(s(tab%treturn%r))', 'tab%treturn%r'); 
    11 test('decompose.4', $god, 'think decompose(before(ansi(h,x),x)hello)', 'hello'); 
    12 test('decompose.5', $god, 'think decompose([before(ansi(h,blah),\[)])', '\[ansi\(h,blah\)\]'); 
     1login mortal 
     2run test: 
     3test('decompose.1', $mortal, 'think decompose([ansi(hr,b[ansi(f,la)]h)])', '\[ansi\(hr,b(\)\])?\[ansi\((?(1)fhr|f),la\)\](?(1)\[ansi\(hr,h|h)\)\]'); 
     4test('decompose.2', $mortal, 'think decompose(a\ \ \ \ b)', 'a %b %bb'); 
     5test('decompose.3', $mortal, 'think decompose(s(tab%treturn%r))', 'tab%treturn%r'); 
     6test('decompose.4', $mortal, 'think decompose(before(ansi(h,x),x)hello)', 'hello'); 
     7test('decompose.5', $mortal, 'think decompose([before(ansi(h,blah),\[)])', '\[ansi\(h,blah\)\]'); 
  • 1.8.3/branches/devel/test/testdigest.pl

    r1003 r1078  
    1 use PennMUSH; 
    2 use MUSHConnection; 
    3 use TestHarness; 
    4  
    5 $mush = PennMUSH->new(); 
    6 $god = $mush->loginGod(); 
    7  
    8 test('digest.1', $god, 'think digest(md2,foo)', 'd11f8ce29210b4b50c5e67533b699d02'); 
    9 test('digest.2', $god, 'think digest(md5,foo)', 'acbd18db4cc2f85cedef654fccc4a4d8'); 
    10 test('digest.3', $god, 'think digest(sha,foo)', '752678a483e77799a3651face01d064f9ca86779'); 
    11 test('digest.4', $god, 'think digest(sha1,foo)', '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'); 
    12 test('digest.5', $god, 'think digest(dss1,foo)', '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'); 
    13 test('digest.6', $god, 'think digest(ripemd160,foo)', '42cfa211018ea492fdee45ac637b7972a0ad6873'); 
    14 test('digest.7', $god, 'think digest(md4,foo)', '0ac6700c491d70fb8650940b1ca1e4b2'); 
     1login mortal 
     2run tests: 
     3test('digest.1', $mortal, 'think digest(md2,foo)', 'd11f8ce29210b4b50c5e67533b699d02'); 
     4test('digest.2', $mortal, 'think digest(md5,foo)', 'acbd18db4cc2f85cedef654fccc4a4d8'); 
     5test('digest.3', $mortal, 'think digest(sha,foo)', '752678a483e77799a3651face01d064f9ca86779'); 
     6test('digest.4', $mortal, 'think digest(sha1,foo)', '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'); 
     7test('digest.5', $mortal, 'think digest(dss1,foo)', '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'); 
     8test('digest.6', $mortal, 'think digest(ripemd160,foo)', '42cfa211018ea492fdee45ac637b7972a0ad6873'); 
     9test('digest.7', $mortal, 'think digest(md4,foo)', '0ac6700c491d70fb8650940b1ca1e4b2'); 
    1510 
    1611 
    17 test('base64.1', $god, 'think encode64(test string)', 'dGVzdCBzdHJpbmc='); 
    18 test("base64.2", $god, "think decode64(encode64(this is another fine mess you've gotten us into))", "this is another fine mess you've gotten us into"); 
     12test('base64.1', $mortal, 'think encode64(test string)', 'dGVzdCBzdHJpbmc='); 
     13test("base64.2", $mortal, "think decode64(encode64(this is another fine mess you've gotten us into))", "this is another fine mess you've gotten us into"); 
  • 1.8.3/branches/devel/test/testdistxd.pl

    r957 r1078  
    1 use PennMUSH; 
    2 use TestHarness; 
    3  
    4 my $mush = PennMUSH->new; 
    5 my $god = $mush->loginGod; 
    6  
     1run tests: 
    72test('dist2d.1', $god, 'think dist2d(0,0, 5,5)', "7.071068"); 
    83test('dist2d.2', $god, 'think lmath(dist2d, 0 0  5 5)', "7.071068"); 
  • 1.8.3/branches/devel/test/testfirstof.pl

    r523 r1078  
    1 use PennMUSH; 
    2 use MUSHConnection; 
    3 use TestHarness; 
    4  
    5 $mush = PennMUSH->new(); 
    6 $god = $mush->loginGod(); 
    7  
     1run tests: 
    82test('firstof.1', $god, 'think firstof(0,0,2)', '2'); 
    93test('firstof.2', $god, 'think firstof(2,0,0)', '2'); 
  • 1.8.3/branches/devel/test/testgrep.pl

    r523 r1078  
    1 use PennMUSH; 
    2 use MUSHConnection; 
    3 use TestHarness; 
     1login mortal 
     2run tests: 
     3$mortal->command("&FIRST me=first"); 
     4$mortal->command("&SECOND me=second"); 
     5$mortal->command("&THIRD me=third"); 
    46 
    5 $mush = PennMUSH->new(); 
    6 $god = $mush->loginGod(); 
     7test('grep.1', $mortal, 'think grep(me,*,d)', 'SECOND THIRD'); 
     8test('grep.2', $mortal, 'think grep(me,S*,d)', 'SECOND'); 
     9test('grep.3', $mortal, 'think grep(me,*,*d*)', '!SECOND THIRD'); 
     10test('grep.4', $mortal, 'think grep(me,*,D)', '!SECOND THIRD'); 
    711 
    8 $god->command("&FIRST me=first"); 
    9 $god->command("&SECOND me=second"); 
    10 $god->command("&THIRD me=third"); 
     12test('grep.5', $mortal, 'think wildgrep(me,*,*d*)', 'SECOND THIRD'); 
     13test('grep.6', $mortal, 'think wildgrep(me,*,d)', '!SECOND THIRD'); 
     14test('grep.7', $mortal, 'think wildgrep(me,*,first)', 'FIRST'); 
     15test('grep.8', $mortal, 'think wildgrep(me,*,FIRST)', '!FIRST'); 
    1116 
    12 test('grep.1', $god, 'think grep(me,*,d)', 'SECOND THIRD'); 
    13 test('grep.2', $god, 'think grep(me,S*,d)', 'SECOND'); 
    14 test('grep.3', $god, 'think grep(me,*,*d*)', '!SECOND THIRD'); 
    15 test('grep.4', $god, 'think grep(me,*,D)', '!SECOND THIRD'); 
     17test('grep.9', $mortal, 'think regrep(me,*,*d*)', '!SECOND THIRD'); 
     18test('grep.10', $mortal, 'think regrep(me,*,d)', 'SECOND THIRD'); 
     19test('grep.11', $mortal, 'think regrep(me,*,d$)', 'SECOND THIRD'); 
     20test('grep.12', $mortal, 'think regrep(me,*,first)', 'FIRST'); 
     21test('grep.13', $mortal, 'think regrep(me,*,FIRST)', '!FIRST'); 
    1622 
    17 test('grep.5', $god, 'think wildgrep(me,*,*d*)', 'SECOND THIRD'); 
    18 test('grep.6', $god, 'think wildgrep(me,*,d)', '!SECOND THIRD'); 
    19 test('grep.7', $god, 'think wildgrep(me,*,first)', 'FIRST'); 
    20 test('grep.8', $god, 'think wildgrep(me,*,FIRST)', '!FIRST'); 
     23test('grep.14', $mortal, 'think grepi(me,*,d)', 'SECOND THIRD'); 
     24test('grep.15', $mortal, 'think grepi(me,S*,d)', 'SECOND'); 
     25test('grep.16', $mortal, 'think grepi(me,*,*d*)', '!SECOND THIRD'); 
     26test('grep.17', $mortal, 'think grepi(me,*,D)', 'SECOND THIRD'); 
    2127 
    22 test('grep.9', $god, 'think regrep(me,*,*d*)', '!SECOND THIRD'); 
    23 test('grep.10', $god, 'think regrep(me,*,d)', 'SECOND THIRD'); 
    24 test('grep.11', $god, 'think regrep(me,*,d$)', 'SECOND THIRD'); 
    25 test('grep.12', $god, 'think regrep(me,*,first)', 'FIRST'); 
    26 test('grep.13', $god, 'think regrep(me,*,FIRST)', '!FIRST'); 
     28test('grep.18', $mortal, 'think wildgrepi(me,*,*d*)', 'SECOND THIRD'); 
     29test('grep.19', $mortal, 'think wildgrepi(me,*,d)', '!SECOND THIRD'); 
     30test('grep.20', $mortal, 'think wildgrepi(me,*,first)', 'FIRST'); 
     31test('grep.21', $mortal, 'think wildgrepi(me,*,FIRST)', 'FIRST'); 
    2732 
    28 test('grep.14', $god, 'think grepi(me,*,d)', 'SECOND THIRD'); 
    29 test('grep.15', $god, 'think grepi(me,S*,d)', 'SECOND'); 
    30 test('grep.16', $god, 'think grepi(me,*,*d*)', '!SECOND THIRD'); 
    31 test('grep.17', $god, 'think grepi(me,*,D)', 'SECOND THIRD'); 
    32  
    33 test('grep.18', $god, 'think wildgrepi(me,*,*d*)', 'SECOND THIRD'); 
    34 test('grep.19', $god, 'think wildgrepi(me,*,d)', '!SECOND THIRD'); 
    35 test('grep.20', $god, 'think wildgrepi(me,*,first)', 'FIRST'); 
    36 test('grep.21', $god, 'think wildgrepi(me,*,FIRST)', 'FIRST'); 
    37  
    38 test('grep.22', $god, 'think regrepi(me,*,*d*)', '!SECOND THIRD'); 
    39 test('grep.23', $god, 'think regrepi(me,*,d)', 'SECOND THIRD'); 
    40 test('grep.24', $god, 'think regrepi(me,*,d$)', 'SECOND THIRD'); 
    41 test('grep.25', $god, 'think regrepi(me,*,first)', 'FIRST'); 
    42 test('grep.26', $god, 'think regrepi(me,*,FIRST)', 'FIRST'); 
     33test('grep.22', $mortal, 'think regrepi(me,*,*d*)', '!SECOND THIRD'); 
     34test('grep.23', $mortal, 'think regrepi(me,*,d)', 'SECOND THIRD'); 
     35test('grep.24', $mortal, 'think regrepi(me,*,d$)', 'SECOND THIRD'); 
     36test('grep.25', $mortal, 'think regrepi(me,*,first)', 'FIRST'); 
     37test('grep.26', $mortal, 'think regrepi(me,*,FIRST)', 'FIRST'); 
  • 1.8.3/branches/devel/test/testhastype.pl

    r439 r1078  
    1 use PennMUSH; 
    2 use MUSHConnection; 
    3 use TestHarness; 
    4  
    5 $mush = PennMUSH->new(); 
    6 $god = $mush->loginGod(); 
    7  
     1expect 2 failures! 
     2run tests: 
    83test('hastype.1', $god, 'think hastype(#0, room)', ['1', '!#-1']); 
    94test('hastype.2', $god, 'think hastype(#1, player)', ['1', '!#-1']); 
  • 1.8.3/branches/devel/test/testjust.pl

    r957 r1078  
    1 # Test ljust(), rjust(), center() 
    2  
    3 use PennMUSH; 
    4 use TestHarness; 
    5  
    6 my $mush = PennMUSH->new(); 
    7 my $god = $mush->loginGod(); 
    8  
     1run tests: 
     2$god->command('@config/set tiny_math=no'); 
    93test('ljust.1', $god, "think ljust(foo, 3)", 'foo'); 
    104test('ljust.2', $god, "think ljust(foo, 5)X", '^foo  X'); 
  • 1.8.3/branches/devel/test/testletq.pl

    r909 r1078  
    1 use PennMUSH; 
    2 use TestHarness; 
    3  
    4 my $mush = PennMUSH->new(); 
    5 my $god = $mush->loginGod(); 
    6  
     1run tests: 
    72test("letq.1", $god, "think setr(A, 1):[letq(A, 2, \%qA)]:\%qA", '^1:2:1'); 
    83test("letq.2", $god, "think setr(A, 1):[letq(setr(A, 2))]:\%qA", '^1:2:2'); 
  • 1.8.3/branches/devel/test/testmath.pl

    r523 r1078  
    1 use PennMUSH; 
    2 use MUSHConnection; 
    3 use TestHarness; 
    4  
    5 $mush = PennMUSH->new(); 
    6 $god = $mush->loginGod(); 
    7  
     1run tests: 
    82test('abs.1', $god, 'think abs(-1)', '1'); 
    93test('abs.2', $god, 'think abs(-1.5)', '1.5'); 
  • 1.8.3/branches/devel/test/testnull.pl

    r523 r1078  
    1 use PennMUSH; 
    2 use MUSHConnection; 
    3 use TestHarness; 
    4  
    5 $mush = PennMUSH->new(); 
    6 $god = $mush->loginGod(); 
    7  
     1run test: 
    82test('null.1', $god, 'think null()', ''); 
    93test('null.2', $god, 'think null(a)', ''); 
  • 1.8.3/branches/devel/test/testpage.pl

    r563 r1078  
    1 use PennMUSH; 
    2 use MUSHConnection; 
    3 use TestHarness; 
    4  
    5 $mush = PennMUSH->new(); 
    6 $god = $mush->loginGod(); 
    7  
     1run tests: 
    82test('page.1', $god, 'page/noeval %# \= =',"I can't find"); # Former crasher 
  • 1.8.3/branches/devel/test/testrand.pl

    r441 r1078  
    1 use PennMUSH; 
    2 use MUSHConnection; 
    3 use TestHarness; 
    4  
    5 $mush = PennMUSH->new(); 
    6 $god = $mush->loginGod(); 
    7  
     1run tests: 
    82test('rand.1', $god, 'think rand(-1)', '#-1'); 
    93test('rand.2', $god, 'think rand(0)', '#-1'); 
  • 1.8.3/branches/devel/test/testreswitch.pl

    r523 r1078  
    1 use PennMUSH; 
    2 use MUSHConnection; 
    3 use TestHarness; 
    4  
    5 $mush = PennMUSH->new(); 
    6 $god = $mush->loginGod(); 
    7  
     1run tests: 
    82test('reswitch.1', $god, 'think reswitch(test STRING,t,1,0)', '1'); 
    93test('reswitch.2', $god, 'think reswitch(test STRING,t,1,e,2,0)', '1'); 
  • 1.8.3/branches/devel/test/testsetfuns.pl

    r529 r1078  
    1 use PennMUSH; 
    2 use MUSHConnection; 
    3 use TestHarness; 
    4  
    5 $mush = PennMUSH->new(); 
    6 $god = $mush->loginGod(); 
    7  
    8 test('setunion.1', $god, 'think setunion(,)', '^$'); 
    9 test('setunion.2', $god, 'think setunion( a,a)', '^a\r$'); 
    10 test('setunion.3', $god, 'think setunion(c a b a,a b c c)', '^a b c\r$'); 
    11 test('setunion.4', $god, 'think setunion(a a a,)', '^a\r$'); 
    12 test('setunion.5', $god, 'think setunion(,a a a)', '^a\r$'); 
     1login mortal 
     2run tests: 
     3test('setunion.1', $mortal, 'think setunion(,)', '^$'); 
     4test('setunion.2', $mortal, 'think setunion( a,a)', '^a\r$'); 
     5test('setunion.3', $mortal, 'think setunion(c a b a,a b c c)', '^a b c\r$'); 
     6test('setunion.4', $mortal, 'think setunion(a a a,)', '^a\r$'); 
     7test('setunion.5', $mortal, 'think setunion(,a a a)', '^a\r$'); 
  • 1.8.3/branches/devel/test/teststringsecs.pl

    r706 r1078  
    1 use PennMUSH; 
    2 use MUSHConnection; 
    3 use TestHarness; 
    4  
    5 $mush = PennMUSH->new(); 
    6 $god = $mush->loginGod(); 
    7  
    8 test('stringsecs.1', $god, 'think stringsecs(a)', '#-1 INVALID TIMESTRING'); 
    9 test('stringsecs.2', $god, 'think stringsecs(10)', '10'); 
    10 test('stringsecs.3', $god, 'think stringsecs(10s)', '10'); 
    11 test('stringsecs.4', $god, 'think stringsecs(5m)', '300'); 
    12 test('stringsecs.5', $god, 'think stringsecs(5m 10s)', '310'); 
    13 test('stringsecs.6', $god, 'think stringsecs(1h)', '3600'); 
    14 test('stringsecs.7', $god, 'think stringsecs(10s 5m)', '310'); 
    15 test('stringsecs.8', $god, 'think stringsecs(1d 2h 3m 4s)', '93784'); 
    16 test('stringsecs.9', $god, 'think stringsecs(h)', '#-1 INVALID TIMESTRING'); 
     1login mortal 
     2run tests: 
     3test('stringsecs.1', $mortal, 'think stringsecs(a)', '#-1 INVALID TIMESTRING'); 
     4test('stringsecs.2', $mortal, 'think stringsecs(10)', '10'); 
     5test('stringsecs.3', $mortal, 'think stringsecs(10s)', '10'); 
     6test('stringsecs.4', $mortal, 'think stringsecs(5m)', '300'); 
     7test('stringsecs.5', $mortal, 'think stringsecs(5m 10s)', '310'); 
     8test('stringsecs.6', $mortal, 'think stringsecs(1h)', '3600'); 
     9test('stringsecs.7', $mortal, 'think stringsecs(10s 5m)', '310'); 
     10test('stringsecs.8', $mortal, 'think stringsecs(1d 2h 3m 4s)', '93784'); 
     11test('stringsecs.9', $mortal 
     12     , 'think stringsecs(h)', '#-1 INVALID TIMESTRING'); 
  • 1.8.3/branches/devel/test/testtr.pl

    r523 r1078  
    1 use PennMUSH; 
    2 use MUSHConnection; 
    3 use TestHarness; 
    4  
    5 $mush = PennMUSH->new(); 
    6 $god = $mush->loginGod(); 
    7  
     1run tests: 
    82test('tr.1', $god, 'think tr(test STRING,,)', 'test STRING'); 
    93test('tr.2', $god, 'think tr(test STRING,t,)', '#-1');