Changeset 1078
- Timestamp:
- 08/23/07 23:53:33 (1 year ago)
- Files:
-
- 1.8.3/branches/devel/CHANGES.183 (modified) (1 diff)
- 1.8.3/branches/devel/MANIFEST (modified) (2 diffs)
- 1.8.3/branches/devel/configure (modified) (3 diffs)
- 1.8.3/branches/devel/configure.in (modified) (1 diff)
- 1.8.3/branches/devel/test/README (added)
- 1.8.3/branches/devel/test/TestHarness.pm (modified) (4 diffs)
- 1.8.3/branches/devel/test/alltests.pl (deleted)
- 1.8.3/branches/devel/test/alltests.sh.in (added)
- 1.8.3/branches/devel/test/runtest.pl (added)
- 1.8.3/branches/devel/test/testalias.pl (modified) (1 diff)
- 1.8.3/branches/devel/test/testatree.pl (modified) (2 diffs)
- 1.8.3/branches/devel/test/testdecompose.pl (modified) (1 diff)
- 1.8.3/branches/devel/test/testdigest.pl (modified) (1 diff)
- 1.8.3/branches/devel/test/testdistxd.pl (modified) (1 diff)
- 1.8.3/branches/devel/test/testfirstof.pl (modified) (1 diff)
- 1.8.3/branches/devel/test/testgrep.pl (modified) (1 diff)
- 1.8.3/branches/devel/test/testhastype.pl (modified) (1 diff)
- 1.8.3/branches/devel/test/testjust.pl (modified) (1 diff)
- 1.8.3/branches/devel/test/testletq.pl (modified) (1 diff)
- 1.8.3/branches/devel/test/testmath.pl (modified) (1 diff)
- 1.8.3/branches/devel/test/testnull.pl (modified) (1 diff)
- 1.8.3/branches/devel/test/testpage.pl (modified) (1 diff)
- 1.8.3/branches/devel/test/testrand.pl (modified) (1 diff)
- 1.8.3/branches/devel/test/testreswitch.pl (modified) (1 diff)
- 1.8.3/branches/devel/test/testsetfuns.pl (modified) (1 diff)
- 1.8.3/branches/devel/test/teststringsecs.pl (modified) (1 diff)
- 1.8.3/branches/devel/test/testtr.pl (modified) (1 diff)
- 1.8.3/branches/devel/test/testtrim.pl (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
1.8.3/branches/devel/CHANGES.183
r1074 r1078 20 20 * Significant rewrite of ansi parsing and better ansi support 21 21 for many string-handling functions. Patch by Sketch. 22 * Rewrite of the softcode regression testing framework, and 23 addition of more tests. [SW] 22 24 23 25 Minor changes: 1.8.3/branches/devel/MANIFEST
r998 r1078 234 234 src/wild.c 235 235 src/wiz.c 236 test/README 236 237 test/MUSHConnection.pm 237 238 test/PennMUSH.pm 238 239 test/TestHarness.pm 239 test/alltests.pl 240 test/alltests.sh.in 241 test/runtest.pl 240 242 test/testalias.pl 241 243 test/testatree.pl … … 257 259 test/teststringsecs.pl 258 260 test/testtr.pl 261 test/testtrim.pl 259 262 utils/clwrapper.sh 260 263 utils/customize.pl 1.8.3/branches/devel/configure
r1017 r1078 17944 17944 ac_config_files="$ac_config_files game/txt/compose.sh" 17945 17945 17946 ac_config_files="$ac_config_files test/alltests.sh" 17947 17946 17948 cat >confcache <<\_ACEOF 17947 17949 # This file is a shell script that caches the results of configure … … 18488 18490 "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; 18489 18491 "game/txt/compose.sh") CONFIG_FILES="$CONFIG_FILES game/txt/compose.sh" ;; 18492 "test/alltests.sh") CONFIG_FILES="$CONFIG_FILES test/alltests.sh" ;; 18490 18493 18491 18494 *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 … … 19034 19037 case $ac_file$ac_mode in 19035 19038 "game/txt/compose.sh":F) chmod +x game/txt/compose.sh ;; 19039 "test/alltests.sh":F) chmod +x test/alltests.sh ;; 19036 19040 19037 19041 esac 1.8.3/branches/devel/configure.in
r1017 r1078 288 288 AC_CONFIG_FILES([Makefile src/Makefile]) 289 289 AC_CONFIG_FILES([game/txt/compose.sh], [chmod +x game/txt/compose.sh]) 290 AC_CONFIG_FILES([test/alltests.sh], [chmod +x test/alltests.sh]) 290 291 AC_OUTPUT 1.8.3/branches/devel/test/TestHarness.pm
r439 r1078 1 1 package TestHarness; 2 use strict; 3 use vars qw/%tests $testcount @failures $alltests $allfailures $allexpected/; 4 use vars qw/$testfiles $use_mortal/; 5 use subs qw/test summary/; 2 6 3 require Exporter; 7 $alltests = 0; 8 $allfailures = 0; 9 $allexpected = 0; 10 $testfiles = 0; 11 $use_mortal = 0; 4 12 5 @ISA = qw(Exporter); 13 sub 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 } 6 55 7 @EXPORT = qw(test summary); 56 sub run { 57 my $self = shift; 58 my $god = shift; 59 my $mortal = shift; 60 my ($failures, $test) = (0,0); 8 61 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 87 END { 88 print "Totals:\n"; 89 summary("all tests run", $alltests, $allfailures, $allexpected) 90 if $testfiles > 1; 91 } 11 92 12 93 $| = 1; … … 25 106 my $verdict = 1; 26 107 27 my $pattern; 28 foreach $pattern (@$patterns) { 108 foreach my $pattern (@$patterns) { 29 109 my $matchpattern = $pattern; 30 110 my $negate = 0; … … 57 137 print " result: $result\n"; 58 138 } 59 foreach $pattern (@$patterns) {139 foreach my $pattern (@$patterns) { 60 140 print " pattern: $pattern\n"; 61 141 } … … 65 145 66 146 sub 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; 78 155 } 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"; 88 168 } 89 169 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 1 run tests: 8 2 test('alias.1', $god, '@name me=God', ['Name set.']); 9 3 test('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 1 login mortal 2 run tests: 12 3 # First, the basic tests enforcing tree-nature of the attributes. 13 4 # Attrs may not start or end in ` … … 92 83 # Permissions checks 93 84 # Need a mortal for this... 94 test('atree.perms.1', $god, '@pcreate Mortal=mortal', 'created');95 $mortal = $mush->login("Mortal", "mortal");96 85 # Build a tree from different places... 97 86 test('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\)\]'); 1 login mortal 2 run test: 3 test('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)\)\]'); 4 test('decompose.2', $mortal, 'think decompose(a\ \ \ \ b)', 'a %b %bb'); 5 test('decompose.3', $mortal, 'think decompose(s(tab%treturn%r))', 'tab%treturn%r'); 6 test('decompose.4', $mortal, 'think decompose(before(ansi(h,x),x)hello)', 'hello'); 7 test('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'); 1 login mortal 2 run tests: 3 test('digest.1', $mortal, 'think digest(md2,foo)', 'd11f8ce29210b4b50c5e67533b699d02'); 4 test('digest.2', $mortal, 'think digest(md5,foo)', 'acbd18db4cc2f85cedef654fccc4a4d8'); 5 test('digest.3', $mortal, 'think digest(sha,foo)', '752678a483e77799a3651face01d064f9ca86779'); 6 test('digest.4', $mortal, 'think digest(sha1,foo)', '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'); 7 test('digest.5', $mortal, 'think digest(dss1,foo)', '0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33'); 8 test('digest.6', $mortal, 'think digest(ripemd160,foo)', '42cfa211018ea492fdee45ac637b7972a0ad6873'); 9 test('digest.7', $mortal, 'think digest(md4,foo)', '0ac6700c491d70fb8650940b1ca1e4b2'); 15 10 16 11 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");12 test('base64.1', $mortal, 'think encode64(test string)', 'dGVzdCBzdHJpbmc='); 13 test("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 1 run tests: 7 2 test('dist2d.1', $god, 'think dist2d(0,0, 5,5)', "7.071068"); 8 3 test('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 1 run tests: 8 2 test('firstof.1', $god, 'think firstof(0,0,2)', '2'); 9 3 test('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; 1 login mortal 2 run tests: 3 $mortal->command("&FIRST me=first"); 4 $mortal->command("&SECOND me=second"); 5 $mortal->command("&THIRD me=third"); 4 6 5 $mush = PennMUSH->new(); 6 $god = $mush->loginGod(); 7 test('grep.1', $mortal, 'think grep(me,*,d)', 'SECOND THIRD'); 8 test('grep.2', $mortal, 'think grep(me,S*,d)', 'SECOND'); 9 test('grep.3', $mortal, 'think grep(me,*,*d*)', '!SECOND THIRD'); 10 test('grep.4', $mortal, 'think grep(me,*,D)', '!SECOND THIRD'); 7 11 8 $god->command("&FIRST me=first"); 9 $god->command("&SECOND me=second"); 10 $god->command("&THIRD me=third"); 12 test('grep.5', $mortal, 'think wildgrep(me,*,*d*)', 'SECOND THIRD'); 13 test('grep.6', $mortal, 'think wildgrep(me,*,d)', '!SECOND THIRD'); 14 test('grep.7', $mortal, 'think wildgrep(me,*,first)', 'FIRST'); 15 test('grep.8', $mortal, 'think wildgrep(me,*,FIRST)', '!FIRST'); 11 16 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'); 17 test('grep.9', $mortal, 'think regrep(me,*,*d*)', '!SECOND THIRD'); 18 test('grep.10', $mortal, 'think regrep(me,*,d)', 'SECOND THIRD'); 19 test('grep.11', $mortal, 'think regrep(me,*,d$)', 'SECOND THIRD'); 20 test('grep.12', $mortal, 'think regrep(me,*,first)', 'FIRST'); 21 test('grep.13', $mortal, 'think regrep(me,*,FIRST)', '!FIRST'); 16 22 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');23 test('grep.14', $mortal, 'think grepi(me,*,d)', 'SECOND THIRD'); 24 test('grep.15', $mortal, 'think grepi(me,S*,d)', 'SECOND'); 25 test('grep.16', $mortal, 'think grepi(me,*,*d*)', '!SECOND THIRD'); 26 test('grep.17', $mortal, 'think grepi(me,*,D)', 'SECOND THIRD'); 21 27 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'); 28 test('grep.18', $mortal, 'think wildgrepi(me,*,*d*)', 'SECOND THIRD'); 29 test('grep.19', $mortal, 'think wildgrepi(me,*,d)', '!SECOND THIRD'); 30 test('grep.20', $mortal, 'think wildgrepi(me,*,first)', 'FIRST'); 31 test('grep.21', $mortal, 'think wildgrepi(me,*,FIRST)', 'FIRST'); 27 32 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'); 33 test('grep.22', $mortal, 'think regrepi(me,*,*d*)', '!SECOND THIRD'); 34 test('grep.23', $mortal, 'think regrepi(me,*,d)', 'SECOND THIRD'); 35 test('grep.24', $mortal, 'think regrepi(me,*,d$)', 'SECOND THIRD'); 36 test('grep.25', $mortal, 'think regrepi(me,*,first)', 'FIRST'); 37 test('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 1 expect 2 failures! 2 run tests: 8 3 test('hastype.1', $god, 'think hastype(#0, room)', ['1', '!#-1']); 9 4 test('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 1 run tests: 2 $god->command('@config/set tiny_math=no'); 9 3 test('ljust.1', $god, "think ljust(foo, 3)", 'foo'); 10 4 test('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 1 run tests: 7 2 test("letq.1", $god, "think setr(A, 1):[letq(A, 2, \%qA)]:\%qA", '^1:2:1'); 8 3 test("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 1 run tests: 8 2 test('abs.1', $god, 'think abs(-1)', '1'); 9 3 test('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 1 run test: 8 2 test('null.1', $god, 'think null()', ''); 9 3 test('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 1 run tests: 8 2 test('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 1 run tests: 8 2 test('rand.1', $god, 'think rand(-1)', '#-1'); 9 3 test('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 1 run tests: 8 2 test('reswitch.1', $god, 'think reswitch(test STRING,t,1,0)', '1'); 9 3 test('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$'); 1 login mortal 2 run tests: 3 test('setunion.1', $mortal, 'think setunion(,)', '^$'); 4 test('setunion.2', $mortal, 'think setunion( a,a)', '^a\r$'); 5 test('setunion.3', $mortal, 'think setunion(c a b a,a b c c)', '^a b c\r$'); 6 test('setunion.4', $mortal, 'think setunion(a a a,)', '^a\r$'); 7 test('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'); 1 login mortal 2 run tests: 3 test('stringsecs.1', $mortal, 'think stringsecs(a)', '#-1 INVALID TIMESTRING'); 4 test('stringsecs.2', $mortal, 'think stringsecs(10)', '10'); 5 test('stringsecs.3', $mortal, 'think stringsecs(10s)', '10'); 6 test('stringsecs.4', $mortal, 'think stringsecs(5m)', '300'); 7 test('stringsecs.5', $mortal, 'think stringsecs(5m 10s)', '310'); 8 test('stringsecs.6', $mortal, 'think stringsecs(1h)', '3600'); 9 test('stringsecs.7', $mortal, 'think stringsecs(10s 5m)', '310'); 10 test('stringsecs.8', $mortal, 'think stringsecs(1d 2h 3m 4s)', '93784'); 11 test('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 1 run tests: 8 2 test('tr.1', $god, 'think tr(test STRING,,)', 'test STRING'); 9 3 test('tr.2', $god, 'think tr(test STRING,t,)', '#-1');
