perl-test-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r170671 [3/4] - in /perl/Apache-Test/branches/test-more-unstable: ./ Test-Simple/ Test-Simple/lib/ Test-Simple/lib/Test/ Test-Simple/t/ Test-Simple/t/lib/ Test-Simple/t/lib/Test/ Test-Simple/t/lib/Test/Simple/ Test-Simple/t/lib/Test/Simple/sample_tests/
Date Tue, 17 May 2005 21:38:02 GMT
Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/lib/Test/Tutorial.pod
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/lib/Test/Tutorial.pod?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/lib/Test/Tutorial.pod (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/lib/Test/Tutorial.pod Tue May 17 14:38:00 2005
@@ -0,0 +1,603 @@
+=head1 NAME
+
+Test::Tutorial - A tutorial about writing really basic tests
+
+=head1 DESCRIPTION
+
+
+I<AHHHHHHH!!!!  NOT TESTING!  Anything but testing!  
+Beat me, whip me, send me to Detroit, but don't make 
+me write tests!>
+
+I<*sob*>
+
+I<Besides, I don't know how to write the damned things.>
+
+
+Is this you?  Is writing tests right up there with writing
+documentation and having your fingernails pulled out?  Did you open up
+a test and read 
+
+    ######## We start with some black magic
+
+and decide that's quite enough for you?
+
+It's ok.  That's all gone now.  We've done all the black magic for
+you.  And here are the tricks...
+
+
+=head2 Nuts and bolts of testing.
+
+Here's the most basic test program.
+
+    #!/usr/bin/perl -w
+
+    print "1..1\n";
+
+    print 1 + 1 == 2 ? "ok 1\n" : "not ok 1\n";
+
+since 1 + 1 is 2, it prints:
+
+    1..1
+    ok 1
+
+What this says is: C<1..1> "I'm going to run one test." [1] C<ok 1>
+"The first test passed".  And that's about all magic there is to
+testing.  Your basic unit of testing is the I<ok>.  For each thing you
+test, an C<ok> is printed.  Simple.  B<Test::Harness> interprets your test
+results to determine if you succeeded or failed (more on that later).
+
+Writing all these print statements rapidly gets tedious.  Fortunately,
+there's B<Test::Simple>.  It has one function, C<ok()>.
+
+    #!/usr/bin/perl -w
+
+    use Test::Simple tests => 1;
+
+    ok( 1 + 1 == 2 );
+
+and that does the same thing as the code above.  C<ok()> is the backbone
+of Perl testing, and we'll be using it instead of roll-your-own from
+here on.  If C<ok()> gets a true value, the test passes.  False, it
+fails.
+
+    #!/usr/bin/perl -w
+
+    use Test::Simple tests => 2;
+    ok( 1 + 1 == 2 );
+    ok( 2 + 2 == 5 );
+
+from that comes
+
+    1..2
+    ok 1
+    not ok 2
+    #     Failed test (test.pl at line 5)
+    # Looks like you failed 1 tests of 2.
+
+C<1..2> "I'm going to run two tests."  This number is used to ensure
+your test program ran all the way through and didn't die or skip some
+tests.  C<ok 1> "The first test passed."  C<not ok 2> "The second test
+failed".  Test::Simple helpfully prints out some extra commentary about
+your tests.
+
+It's not scary.  Come, hold my hand.  We're going to give an example
+of testing a module.  For our example, we'll be testing a date
+library, B<Date::ICal>.  It's on CPAN, so download a copy and follow
+along. [2]
+
+
+=head2 Where to start?
+
+This is the hardest part of testing, where do you start?  People often
+get overwhelmed at the apparent enormity of the task of testing a
+whole module.  Best place to start is at the beginning.  Date::ICal is
+an object-oriented module, and that means you start by making an
+object.  So we test C<new()>.
+
+    #!/usr/bin/perl -w
+
+    use Test::Simple tests => 2;
+
+    use Date::ICal;
+
+    my $ical = Date::ICal->new;         # create an object
+    ok( defined $ical );                # check that we got something
+    ok( $ical->isa('Date::ICal') );     # and it's the right class
+
+run that and you should get:
+
+    1..2
+    ok 1
+    ok 2
+
+congratulations, you've written your first useful test.
+
+
+=head2 Names
+
+That output isn't terribly descriptive, is it?  When you have two
+tests you can figure out which one is #2, but what if you have 102?
+
+Each test can be given a little descriptive name as the second
+argument to C<ok()>.
+
+    use Test::Simple tests => 2;
+
+    ok( defined $ical,              'new() returned something' );
+    ok( $ical->isa('Date::ICal'),   "  and it's the right class" );
+
+So now you'd see...
+
+    1..2
+    ok 1 - new() returned something
+    ok 2 -   and it's the right class
+
+
+=head2 Test the manual
+
+Simplest way to build up a decent testing suite is to just test what
+the manual says it does. [3] Let's pull something out of the 
+L<Date::ICal/SYNOPSIS> and test that all its bits work.
+
+    #!/usr/bin/perl -w
+
+    use Test::Simple tests => 8;
+
+    use Date::ICal;
+
+    $ical = Date::ICal->new( year => 1964, month => 10, day => 16, 
+                             hour => 16, min => 12, sec => 47, 
+                             tz => '0530' );
+
+    ok( defined $ical,            'new() returned something' );
+    ok( $ical->isa('Date::ICal'), "  and it's the right class" );
+    ok( $ical->sec   == 47,       '  sec()'   );
+    ok( $ical->min   == 12,       '  min()'   );    
+    ok( $ical->hour  == 16,       '  hour()'  );
+    ok( $ical->day   == 17,       '  day()'   );
+    ok( $ical->month == 10,       '  month()' );
+    ok( $ical->year  == 1964,     '  year()'  );
+
+run that and you get:
+
+    1..8
+    ok 1 - new() returned something
+    ok 2 -   and it's the right class
+    ok 3 -   sec()
+    ok 4 -   min()
+    ok 5 -   hour()
+    not ok 6 -   day()
+    #     Failed test (- at line 16)
+    ok 7 -   month()
+    ok 8 -   year()
+    # Looks like you failed 1 tests of 8.
+
+Whoops, a failure! [4] Test::Simple helpfully lets us know on what line
+the failure occured, but not much else.  We were supposed to get 17,
+but we didn't.  What did we get??  Dunno.  We'll have to re-run the
+test in the debugger or throw in some print statements to find out.
+
+Instead, we'll switch from B<Test::Simple> to B<Test::More>.  B<Test::More>
+does everything B<Test::Simple> does, and more!  In fact, Test::More does
+things I<exactly> the way Test::Simple does.  You can literally swap
+Test::Simple out and put Test::More in its place.  That's just what
+we're going to do.
+
+Test::More does more than Test::Simple.  The most important difference
+at this point is it provides more informative ways to say "ok".
+Although you can write almost any test with a generic C<ok()>, it
+can't tell you what went wrong.  Instead, we'll use the C<is()>
+function, which lets us declare that something is supposed to be the
+same as something else:
+
+    #!/usr/bin/perl -w
+
+    use Test::More tests => 8;
+
+    use Date::ICal;
+
+    $ical = Date::ICal->new( year => 1964, month => 10, day => 16, 
+                             hour => 16, min => 12, sec => 47, 
+                             tz => '0530' );
+
+    ok( defined $ical,            'new() returned something' );
+    ok( $ical->isa('Date::ICal'), "  and it's the right class" );
+    is( $ical->sec,     47,       '  sec()'   );
+    is( $ical->min,     12,       '  min()'   );    
+    is( $ical->hour,    16,       '  hour()'  );
+    is( $ical->day,     17,       '  day()'   );
+    is( $ical->month,   10,       '  month()' );
+    is( $ical->year,    1964,     '  year()'  );
+
+"Is C<$ical-E<gt>sec> 47?"  "Is C<$ical-E<gt>min> 12?"  With C<is()> in place,
+you get some more information
+
+    1..8
+    ok 1 - new() returned something
+    ok 2 -   and it's the right class
+    ok 3 -   sec()
+    ok 4 -   min()
+    ok 5 -   hour()
+    not ok 6 -   day()
+    #     Failed test (- at line 16)
+    #          got: '16'
+    #     expected: '17'
+    ok 7 -   month()
+    ok 8 -   year()
+    # Looks like you failed 1 tests of 8.
+
+letting us know that C<$ical-E<gt>day> returned 16, but we expected 17.  A
+quick check shows that the code is working fine, we made a mistake
+when writing up the tests.  Just change it to:
+
+    is( $ical->day,     16,       '  day()'   );
+
+and everything works.
+
+So any time you're doing a "this equals that" sort of test, use C<is()>.
+It even works on arrays.  The test is always in scalar context, so you
+can test how many elements are in a list this way. [5]
+
+    is( @foo, 5, 'foo has 5 elements' );
+
+
+=head2 Sometimes the tests are wrong
+
+Which brings us to a very important lesson.  Code has bugs.  Tests are
+code.  Ergo, tests have bugs.  A failing test could mean a bug in the
+code, but don't discount the possibility that the test is wrong.
+
+On the flip side, don't be tempted to prematurely declare a test
+incorrect just because you're having trouble finding the bug.
+Invalidating a test isn't something to be taken lightly, and don't use
+it as a cop out to avoid work.
+
+
+=head2 Testing lots of values
+
+We're going to be wanting to test a lot of dates here, trying to trick
+the code with lots of different edge cases.  Does it work before 1970?
+After 2038?  Before 1904?  Do years after 10,000 give it trouble?
+Does it get leap years right?  We could keep repeating the code above,
+or we could set up a little try/expect loop.
+
+    use Test::More tests => 32;
+    use Date::ICal;
+
+    my %ICal_Dates = (
+            # An ICal string     And the year, month, date
+            #                    hour, minute and second we expect.
+            '19971024T120000' =>    # from the docs.
+                                [ 1997, 10, 24, 12,  0,  0 ],
+            '20390123T232832' =>    # after the Unix epoch
+                                [ 2039,  1, 23, 23, 28, 32 ],
+            '19671225T000000' =>    # before the Unix epoch
+                                [ 1967, 12, 25,  0,  0,  0 ],
+            '18990505T232323' =>    # before the MacOS epoch
+                                [ 1899,  5,  5, 23, 23, 23 ],
+    );
+
+
+    while( my($ical_str, $expect) = each %ICal_Dates ) {
+        my $ical = Date::ICal->new( ical => $ical_str );
+
+        ok( defined $ical,            "new(ical => '$ical_str')" );
+        ok( $ical->isa('Date::ICal'), "  and it's the right class" );
+
+        is( $ical->year,    $expect->[0],     '  year()'  );
+        is( $ical->month,   $expect->[1],     '  month()' );
+        is( $ical->day,     $expect->[2],     '  day()'   );
+        is( $ical->hour,    $expect->[3],     '  hour()'  );
+        is( $ical->min,     $expect->[4],     '  min()'   );    
+        is( $ical->sec,     $expect->[5],     '  sec()'   );
+    }
+
+So now we can test bunches of dates by just adding them to
+C<%ICal_Dates>.  Now that it's less work to test with more dates, you'll
+be inclined to just throw more in as you think of them.
+Only problem is, every time we add to that we have to keep adjusting
+the C<use Test::More tests =E<gt> ##> line.  That can rapidly get
+annoying.  There's two ways to make this work better.
+
+First, we can calculate the plan dynamically using the C<plan()>
+function.
+
+    use Test::More;
+    use Date::ICal;
+
+    my %ICal_Dates = (
+        ...same as before...
+    );
+
+    # For each key in the hash we're running 8 tests.
+    plan tests => keys %ICal_Dates * 8;
+
+Or to be even more flexible, we use C<no_plan>.  This means we're just
+running some tests, don't know how many. [6]
+
+    use Test::More 'no_plan';   # instead of tests => 32
+
+now we can just add tests and not have to do all sorts of math to
+figure out how many we're running.
+
+
+=head2 Informative names
+
+Take a look at this line here
+
+    ok( defined $ical,            "new(ical => '$ical_str')" );
+
+we've added more detail about what we're testing and the ICal string
+itself we're trying out to the name.  So you get results like:
+
+    ok 25 - new(ical => '19971024T120000')
+    ok 26 -   and it's the right class
+    ok 27 -   year()
+    ok 28 -   month()
+    ok 29 -   day()
+    ok 30 -   hour()
+    ok 31 -   min()
+    ok 32 -   sec()
+
+if something in there fails, you'll know which one it was and that
+will make tracking down the problem easier.  So try to put a bit of
+debugging information into the test names.
+
+Describe what the tests test, to make debugging a failed test easier
+for you or for the next person who runs your test.
+
+
+=head2 Skipping tests
+
+Poking around in the existing Date::ICal tests, I found this in
+F<t/01sanity.t> [7]
+
+    #!/usr/bin/perl -w
+
+    use Test::More tests => 7;
+    use Date::ICal;
+
+    # Make sure epoch time is being handled sanely.
+    my $t1 = Date::ICal->new( epoch => 0 );
+    is( $t1->epoch, 0,          "Epoch time of 0" );
+
+    # XXX This will only work on unix systems.
+    is( $t1->ical, '19700101Z', "  epoch to ical" );
+
+    is( $t1->year,  1970,       "  year()"  );
+    is( $t1->month, 1,          "  month()" );
+    is( $t1->day,   1,          "  day()"   );
+
+    # like the tests above, but starting with ical instead of epoch
+    my $t2 = Date::ICal->new( ical => '19700101Z' );
+    is( $t2->ical, '19700101Z', "Start of epoch in ICal notation" );
+
+    is( $t2->epoch, 0,          "  and back to ICal" );
+
+The beginning of the epoch is different on most non-Unix operating
+systems [8].  Even though Perl smooths out the differences for the most
+part, certain ports do it differently.  MacPerl is one off the top of
+my head. [9] We I<know> this will never work on MacOS.  So rather than
+just putting a comment in the test, we can explicitly say it's never
+going to work and skip the test.
+
+    use Test::More tests => 7;
+    use Date::ICal;
+
+    # Make sure epoch time is being handled sanely.
+    my $t1 = Date::ICal->new( epoch => 0 );
+    is( $t1->epoch, 0,          "Epoch time of 0" );
+
+    SKIP: {
+        skip('epoch to ICal not working on MacOS', 6) 
+            if $^O eq 'MacOS';
+
+        is( $t1->ical, '19700101Z', "  epoch to ical" );
+
+        is( $t1->year,  1970,       "  year()"  );
+        is( $t1->month, 1,          "  month()" );
+        is( $t1->day,   1,          "  day()"   );
+
+        # like the tests above, but starting with ical instead of epoch
+        my $t2 = Date::ICal->new( ical => '19700101Z' );
+        is( $t2->ical, '19700101Z', "Start of epoch in ICal notation" );
+
+        is( $t2->epoch, 0,          "  and back to ICal" );
+    }
+
+A little bit of magic happens here.  When running on anything but
+MacOS, all the tests run normally.  But when on MacOS, C<skip()> causes
+the entire contents of the SKIP block to be jumped over.  It's never
+run.  Instead, it prints special output that tells Test::Harness that
+the tests have been skipped.
+
+    1..7
+    ok 1 - Epoch time of 0
+    ok 2 # skip epoch to ICal not working on MacOS
+    ok 3 # skip epoch to ICal not working on MacOS
+    ok 4 # skip epoch to ICal not working on MacOS
+    ok 5 # skip epoch to ICal not working on MacOS
+    ok 6 # skip epoch to ICal not working on MacOS
+    ok 7 # skip epoch to ICal not working on MacOS
+
+This means your tests won't fail on MacOS.  This means less emails
+from MacPerl users telling you about failing tests that you know will
+never work.  You've got to be careful with skip tests.  These are for
+tests which don't work and I<never will>.  It is not for skipping
+genuine bugs (we'll get to that in a moment).
+
+The tests are wholly and completely skipped. [10]  This will work.
+
+    SKIP: {
+        skip("I don't wanna die!");
+
+        die, die, die, die, die;
+    }
+
+
+=head2 Todo tests
+
+Thumbing through the Date::ICal man page, I came across this:
+
+   ical
+
+       $ical_string = $ical->ical;
+
+   Retrieves, or sets, the date on the object, using any
+   valid ICal date/time string.
+
+"Retrieves or sets".  Hmmm, didn't see a test for using C<ical()> to set
+the date in the Date::ICal test suite.  So I'll write one.
+
+    use Test::More tests => 1;
+    use Date::ICal;
+
+    my $ical = Date::ICal->new;
+    $ical->ical('20201231Z');
+    is( $ical->ical, '20201231Z',   'Setting via ical()' );
+
+run that and I get
+
+    1..1
+    not ok 1 - Setting via ical()
+    #     Failed test (- at line 6)
+    #          got: '20010814T233649Z'
+    #     expected: '20201231Z'
+    # Looks like you failed 1 tests of 1.
+
+Whoops!  Looks like it's unimplemented.  Let's assume we don't have
+the time to fix this. [11] Normally, you'd just comment out the test
+and put a note in a todo list somewhere.  Instead, we're going to
+explicitly state "this test will fail" by wrapping it in a C<TODO> block.
+
+    use Test::More tests => 1;
+
+    TODO: {
+        local $TODO = 'ical($ical) not yet implemented';
+
+        my $ical = Date::ICal->new;
+        $ical->ical('20201231Z');
+
+        is( $ical->ical, '20201231Z',   'Setting via ical()' );
+    }
+
+Now when you run, it's a little different:
+
+    1..1
+    not ok 1 - Setting via ical() # TODO ical($ical) not yet implemented
+    #          got: '20010822T201551Z'
+    #     expected: '20201231Z'
+
+Test::More doesn't say "Looks like you failed 1 tests of 1".  That '#
+TODO' tells Test::Harness "this is supposed to fail" and it treats a
+failure as a successful test.  So you can write tests even before
+you've fixed the underlying code.
+
+If a TODO test passes, Test::Harness will report it "UNEXPECTEDLY
+SUCCEEDED".  When that happens, you simply remove the TODO block with
+C<local $TODO> and turn it into a real test.
+
+
+=head2 Testing with taint mode.
+
+Taint mode is a funny thing.  It's the globalest of all global
+features.  Once you turn it on, it affects I<all> code in your program
+and I<all> modules used (and all the modules they use).  If a single
+piece of code isn't taint clean, the whole thing explodes.  With that
+in mind, it's very important to ensure your module works under taint
+mode.
+
+It's very simple to have your tests run under taint mode.  Just throw
+a C<-T> into the C<#!> line.  Test::Harness will read the switches
+in C<#!> and use them to run your tests.
+
+    #!/usr/bin/perl -Tw
+
+    ...test normally here...
+
+So when you say C<make test> it will be run with taint mode and
+warnings on.
+
+
+=head1 FOOTNOTES
+
+=over 4
+
+=item 1
+
+The first number doesn't really mean anything, but it has to be 1.
+It's the second number that's important.
+
+=item 2
+
+For those following along at home, I'm using version 1.31.  It has
+some bugs, which is good -- we'll uncover them with our tests.
+
+=item 3
+
+You can actually take this one step further and test the manual
+itself.  Have a look at B<Test::Inline> (formerly B<Pod::Tests>).
+
+=item 4
+
+Yes, there's a mistake in the test suite.  What!  Me, contrived?
+
+=item 5
+
+We'll get to testing the contents of lists later.
+
+=item 6
+
+But what happens if your test program dies halfway through?!  Since we
+didn't say how many tests we're going to run, how can we know it
+failed?  No problem, Test::More employs some magic to catch that death
+and turn the test into a failure, even if every test passed up to that
+point.
+
+=item 7
+
+I cleaned it up a little.
+
+=item 8
+
+Most Operating Systems record time as the number of seconds since a
+certain date.  This date is the beginning of the epoch.  Unix's starts
+at midnight January 1st, 1970 GMT.
+
+=item 9
+
+MacOS's epoch is midnight January 1st, 1904.  VMS's is midnight,
+November 17th, 1858, but vmsperl emulates the Unix epoch so it's not a
+problem.
+
+=item 10
+
+As long as the code inside the SKIP block at least compiles.  Please
+don't ask how.  No, it's not a filter.
+
+=item 11
+
+Do NOT be tempted to use TODO tests as a way to avoid fixing simple
+bugs!
+
+=back
+
+=head1 AUTHORS
+
+Michael G Schwern E<lt>schwern@pobox.comE<gt> and the perl-qa dancers!
+
+=head1 COPYRIGHT
+
+Copyright 2001 by Michael G Schwern E<lt>schwern@pobox.comE<gt>.
+
+This documentation is free; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
+Irrespective of its distribution, all code examples in these files
+are hereby placed into the public domain.  You are permitted and
+encouraged to use this code in your own programs for fun
+or for profit as you see fit.  A simple comment in the code giving
+credit would be courteous but is not required.
+
+=cut

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/pm_to_blib
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/pm_to_blib?rev=170671&view=auto
==============================================================================
    (empty)

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/00signature.t
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/00signature.t?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/00signature.t (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/00signature.t Tue May 17 14:38:00 2005
@@ -0,0 +1,33 @@
+#!/usr/bin/perl
+
+use strict;
+use Test::More;
+
+if (!eval { require Module::Signature; 1 }) {
+    plan skip_all => 
+      "Next time around, consider installing Module::Signature, ".
+      "so you can verify the integrity of this distribution.";
+}
+elsif ( !-e 'SIGNATURE' ) {
+    plan skip_all => "SIGNATURE not found";
+}
+elsif ( -s 'SIGNATURE' == 0 ) {
+    plan skip_all => "SIGNATURE file empty";
+}
+elsif (!eval { require Socket; Socket::inet_aton('pgp.mit.edu') }) {
+    plan skip_all => "Cannot connect to the keyserver to check module ".
+                     "signature";
+}
+else {
+    plan tests => 1;
+}
+
+my $ret = Module::Signature::verify();
+SKIP: {
+    skip "Module::Signature cannot verify", 1 
+      if $ret eq Module::Signature::CANNOT_VERIFY()   or
+         $ret eq Module::Signature::CIPHER_UNKNOWN();
+
+    cmp_ok $ret, '==', Module::Signature::SIGNATURE_OK(), "Valid signature";
+}
+

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/00signature.t
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/00test_harness_check.t
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/00test_harness_check.t?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/00test_harness_check.t (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/00test_harness_check.t Tue May 17 14:38:00 2005
@@ -0,0 +1,24 @@
+#!/usr/bin/perl -w
+
+# A test to make sure the new Test::Harness was installed properly.
+
+use Test::More;
+plan tests => 1;
+
+require Test::Harness;
+unless( cmp_ok( $Test::Harness::VERSION, '>', 1.20, "T::H version" ) ) {
+    diag <<INSTRUCTIONS;
+
+Test::Simple/More/Builder has features which depend on a version of
+Test::Harness greater than 1.20.  You have $Test::Harness::VERSION.
+Please install a new version from CPAN.
+
+If you've already tried to upgrade Test::Harness and still get this
+message, the new version may be "shadowed" by the old.  Check the
+output of Test::Harness's "make install" for "## Differing version"
+messages.  You can delete the old version by running 
+"make install UNINST=1".
+
+INSTRUCTIONS
+}
+

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/00test_harness_check.t
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/Builder.t
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/Builder.t?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/Builder.t (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/Builder.t Tue May 17 14:38:00 2005
@@ -0,0 +1,30 @@
+#!/usr/bin/perl -w
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = '../lib';
+    }
+}
+
+use Test::Builder;
+my $Test = Test::Builder->new;
+
+$Test->plan( tests => 7 );
+
+my $default_lvl = $Test->level;
+$Test->level(0);
+
+$Test->ok( 1,  'compiled and new()' );
+$Test->ok( $default_lvl == 1,      'level()' );
+
+$Test->is_eq('foo', 'foo',      'is_eq');
+$Test->is_num('23.0', '23',     'is_num');
+
+$Test->is_num( $Test->current_test, 4,  'current_test() get' );
+
+my $test_num = $Test->current_test + 1;
+$Test->current_test( $test_num );
+print "ok $test_num - current_test() set\n";
+
+$Test->ok( 1, 'counter still good' );

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/Builder.t
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/More.t
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/More.t?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/More.t (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/More.t Tue May 17 14:38:00 2005
@@ -0,0 +1,162 @@
+#!perl -w
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = '../lib';
+    }
+}
+
+use Test::More tests => 48;
+
+# Make sure we don't mess with $@ or $!.  Test at bottom.
+my $Err   = "this should not be touched";
+my $Errno = 42;
+$@ = $Err;
+$! = $Errno;
+
+use_ok('Text::Soundex');
+require_ok('Test::More');
+
+
+ok( 2 eq 2,             'two is two is two is two' );
+is(   "foo", "foo",       'foo is foo' );
+isnt( "foo", "bar",     'foo isnt bar');
+isn't("foo", "bar",     'foo isn\'t bar');
+
+#'#
+like("fooble", '/^foo/',    'foo is like fooble');
+like("FooBle", '/foo/i',   'foo is like FooBle');
+like("/usr/local/pr0n/", '/^\/usr\/local/',   'regexes with slashes in like' );
+
+unlike("fbar", '/^bar/',    'unlike bar');
+unlike("FooBle", '/foo/',   'foo is unlike FooBle');
+unlike("/var/local/pr0n/", '/^\/usr\/local/','regexes with slashes in unlike' );
+
+my @foo = qw(foo bar baz);
+unlike(@foo, '/foo/');
+
+can_ok('Test::More', qw(require_ok use_ok ok is isnt like skip can_ok
+                        pass fail eq_array eq_hash eq_set));
+can_ok(bless({}, "Test::More"), qw(require_ok use_ok ok is isnt like skip 
+                                   can_ok pass fail eq_array eq_hash eq_set));
+
+
+isa_ok(bless([], "Foo"), "Foo");
+isa_ok([], 'ARRAY');
+isa_ok(\42, 'SCALAR');
+
+
+# can_ok() & isa_ok should call can() & isa() on the given object, not 
+# just class, in case of custom can()
+{
+       local *Foo::can;
+       local *Foo::isa;
+       *Foo::can = sub { $_[0]->[0] };
+       *Foo::isa = sub { $_[0]->[0] };
+       my $foo = bless([0], 'Foo');
+       ok( ! $foo->can('bar') );
+       ok( ! $foo->isa('bar') );
+       $foo->[0] = 1;
+       can_ok( $foo, 'blah');
+       isa_ok( $foo, 'blah');
+}
+
+
+pass('pass() passed');
+
+ok( eq_array([qw(this that whatever)], [qw(this that whatever)]),
+    'eq_array with simple arrays' );
+is @Test::More::Data_Stack, 0, '@Data_Stack not holding onto things';
+
+ok( eq_hash({ foo => 42, bar => 23 }, {bar => 23, foo => 42}),
+    'eq_hash with simple hashes' );
+is @Test::More::Data_Stack, 0;
+
+ok( eq_set([qw(this that whatever)], [qw(that whatever this)]),
+    'eq_set with simple sets' );
+is @Test::More::Data_Stack, 0;
+
+my @complex_array1 = (
+                      [qw(this that whatever)],
+                      {foo => 23, bar => 42},
+                      "moo",
+                      "yarrow",
+                      [qw(498 10 29)],
+                     );
+my @complex_array2 = (
+                      [qw(this that whatever)],
+                      {foo => 23, bar => 42},
+                      "moo",
+                      "yarrow",
+                      [qw(498 10 29)],
+                     );
+
+is_deeply( \@complex_array1, \@complex_array2,    'is_deeply with arrays' );
+ok( eq_array(\@complex_array1, \@complex_array2),
+    'eq_array with complicated arrays' );
+ok( eq_set(\@complex_array1, \@complex_array2),
+    'eq_set with complicated arrays' );
+
+my @array1 = (qw(this that whatever),
+              {foo => 23, bar => 42} );
+my @array2 = (qw(this that whatever),
+              {foo => 24, bar => 42} );
+
+ok( !eq_array(\@array1, \@array2),
+    'eq_array with slightly different complicated arrays' );
+is @Test::More::Data_Stack, 0;
+
+ok( !eq_set(\@array1, \@array2),
+    'eq_set with slightly different complicated arrays' );
+is @Test::More::Data_Stack, 0;
+
+my %hash1 = ( foo => 23,
+              bar => [qw(this that whatever)],
+              har => { foo => 24, bar => 42 },
+            );
+my %hash2 = ( foo => 23,
+              bar => [qw(this that whatever)],
+              har => { foo => 24, bar => 42 },
+            );
+
+is_deeply( \%hash1, \%hash2,    'is_deeply with complicated hashes' );
+ok( eq_hash(\%hash1, \%hash2),  'eq_hash with complicated hashes');
+
+%hash1 = ( foo => 23,
+           bar => [qw(this that whatever)],
+           har => { foo => 24, bar => 42 },
+         );
+%hash2 = ( foo => 23,
+           bar => [qw(this tha whatever)],
+           har => { foo => 24, bar => 42 },
+         );
+
+ok( !eq_hash(\%hash1, \%hash2),
+    'eq_hash with slightly different complicated hashes' );
+is @Test::More::Data_Stack, 0;
+
+is( Test::Builder->new, Test::More->builder,    'builder()' );
+
+
+cmp_ok(42, '==', 42,        'cmp_ok ==');
+cmp_ok('foo', 'eq', 'foo',  '       eq');
+cmp_ok(42.5, '<', 42.6,     '       <');
+cmp_ok(0, '||', 1,          '       ||');
+
+
+# Piers pointed out sometimes people override isa().
+{
+    package Wibble;
+    sub isa {
+        my($self, $class) = @_;
+        return 1 if $class eq 'Wibblemeister';
+    }
+    sub new { bless {} }
+}
+isa_ok( Wibble->new, 'Wibblemeister' );
+
+
+# These two tests must remain at the end.
+is( $@, $Err,               '$@ untouched' );
+cmp_ok( $!, '==', $Errno,   '$! untouched' );

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/More.t
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/bad_plan.t
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/bad_plan.t?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/bad_plan.t (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/bad_plan.t Tue May 17 14:38:00 2005
@@ -0,0 +1,38 @@
+#!/usr/bin/perl -w
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = '../lib';
+    }
+}
+
+my $test_num = 1;
+# Utility testing functions.
+sub ok ($;$) {
+    my($test, $name) = @_;
+    my $ok = '';
+    $ok .= "not " unless $test;
+    $ok .= "ok $test_num";
+    $ok .= " - $name" if defined $name;
+    $ok .= "\n";
+    print $ok;
+    $test_num++;
+
+    return $test;
+}
+
+
+use Test::Builder;
+my $Test = Test::Builder->new;
+
+print "1..2\n";
+
+eval { $Test->plan(7); };
+ok( $@ =~ /^plan\(\) doesn't understand 7/, 'bad plan()' ) ||
+    print STDERR "# $@";
+
+eval { $Test->plan(wibble => 7); };
+ok( $@ =~ /^plan\(\) doesn't understand wibble 7/, 'bad plan()' ) ||
+    print STDERR "# $@";
+

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/bad_plan.t
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/buffer.t
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/buffer.t?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/buffer.t (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/buffer.t Tue May 17 14:38:00 2005
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = '../lib';
+    }
+}
+
+# Ensure that intermixed prints to STDOUT and tests come out in the
+# right order (ie. no buffering problems).
+
+use Test::More tests => 20;
+my $T = Test::Builder->new;
+$T->no_ending(1);
+
+for my $num (1..10) {
+    $tnum = $num * 2;
+    pass("I'm ok");
+    $T->current_test($tnum);
+    print "ok $tnum - You're ok\n";
+}

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/buffer.t
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/circular_data.t
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/circular_data.t?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/circular_data.t (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/circular_data.t Tue May 17 14:38:00 2005
@@ -0,0 +1,71 @@
+#!/usr/bin/perl -w
+
+# Test is_deeply and friends with circular data structures [rt.cpan.org 7289]
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = ('../lib', 'lib');
+    }
+    else {
+        unshift @INC, 't/lib';
+    }
+}
+
+use strict;
+use Test::More tests => 11;
+
+my $a1 = [ 1, 2, 3 ];
+push @$a1, $a1;
+my $a2 = [ 1, 2, 3 ];
+push @$a2, $a2;
+
+is_deeply $a1, $a2;
+ok( eq_array ($a1, $a2) );
+ok( eq_set   ($a1, $a2) );
+
+my $h1 = { 1=>1, 2=>2, 3=>3 };
+$h1->{4} = $h1;
+my $h2 = { 1=>1, 2=>2, 3=>3 };
+$h2->{4} = $h2;
+
+is_deeply $h1, $h2;
+ok( eq_hash  ($h1, $h2) );
+
+my ($r, $s);
+
+$r = \$r;
+$s = \$s;
+
+ok( eq_array ([$s], [$r]) );
+
+
+{
+    # Classic set of circular scalar refs.
+    my($a,$b,$c);
+    $a = \$b;
+    $b = \$c;
+    $c = \$a;
+
+    my($d,$e,$f);
+    $d = \$e;
+    $e = \$f;
+    $f = \$d;
+
+    is_deeply( $a, $a );
+    is_deeply( $a, $d );
+}
+
+
+{
+    # rt.cpan.org 11623
+    # Make sure the circular ref checks don't get confused by a reference 
+    # which is simply repeating.
+    my $a = {};
+    my $b = {};
+    my $c = {};
+
+    is_deeply( [$a, $a], [$b, $c] );
+    is_deeply( { foo => $a, bar => $a }, { foo => $b, bar => $c } );
+    is_deeply( [\$a, \$a], [\$b, \$c] );
+}

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/circular_data.t
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/create.t
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/create.t?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/create.t (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/create.t Tue May 17 14:38:00 2005
@@ -0,0 +1,43 @@
+#!/usr/bin/perl -w
+
+#!perl -w
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = ('../lib', 'lib');
+    }
+    else {
+        unshift @INC, 't/lib';
+    }
+}
+
+use Test::More tests => 8;
+use Test::Builder;
+
+my $more_tb = Test::More->builder;
+my $new_tb  = Test::Builder->create;
+
+isa_ok $new_tb,  'Test::Builder';
+isa_ok $more_tb, 'Test::Builder';
+
+isnt $more_tb, $new_tb, 'Test::Builder->create makes a new object';
+
+is $more_tb, Test::More->builder, 'create does not interfere with ->builder';
+is $more_tb, Test::Builder->new,  '       does not interfere with ->new';
+
+$new_tb->output("some_file");
+END { 1 while unlink "some_file" }
+
+$new_tb->plan(tests => 1);
+$new_tb->ok(1);
+
+pass("Changing output() of new TB doesn't interfere with singleton");
+
+ok open FILE, "some_file";
+is join("", <FILE>), <<OUT;
+1..1
+ok 1
+OUT
+
+close FILE;

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/create.t
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/curr_test.t
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/curr_test.t?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/curr_test.t (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/curr_test.t Tue May 17 14:38:00 2005
@@ -0,0 +1,11 @@
+#!/usr/bin/perl -w
+
+# Dave Rolsky found a bug where if current_test() is used and no
+# tests are run via Test::Builder it will blow up.
+
+use Test::Builder;
+$TB = Test::Builder->new;
+$TB->plan(tests => 2);
+print "ok 1\n";
+print "ok 2\n";
+$TB->current_test(2);

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/curr_test.t
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/details.t
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/details.t?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/details.t (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/details.t Tue May 17 14:38:00 2005
@@ -0,0 +1,107 @@
+#!/usr/bin/perl -w
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = ('../lib', 'lib');
+    }
+    else {
+        unshift @INC, 't/lib';
+    }
+}
+
+use Test::More;
+use Test::Builder;
+my $Test = Test::Builder->new;
+
+$Test->plan( tests => 9 );
+$Test->level(0);
+
+my @Expected_Details;
+
+$Test->is_num( scalar $Test->summary(), 0,   'no tests yet, no summary' );
+push @Expected_Details, { 'ok'      => 1,
+                          actual_ok => 1,
+                          name      => 'no tests yet, no summary',
+                          type      => '',
+                          reason    => ''
+                        };
+
+# Inline TODO tests will confuse pre 1.20 Test::Harness, so we
+# should just avoid the problem and not print it out.
+my $out_fh  = $Test->output;
+my $todo_fh = $Test->todo_output;
+my $start_test = $Test->current_test + 1;
+require TieOut;
+tie *FH, 'TieOut';
+$Test->output(\*FH);
+$Test->todo_output(\*FH);
+
+SKIP: {
+    $Test->skip( 'just testing skip' );
+}
+push @Expected_Details, { 'ok'      => 1,
+                          actual_ok => 1,
+                          name      => '',
+                          type      => 'skip',
+                          reason    => 'just testing skip',
+                        };
+
+TODO: {
+    local $TODO = 'i need a todo';
+    $Test->ok( 0, 'a test to todo!' );
+
+    push @Expected_Details, { 'ok'       => 1,
+                              actual_ok  => 0,
+                              name       => 'a test to todo!',
+                              type       => 'todo',
+                              reason     => 'i need a todo',
+                            };
+
+    $Test->todo_skip( 'i need both' );
+}
+push @Expected_Details, { 'ok'      => 1,
+                          actual_ok => 0,
+                          name      => '',
+                          type      => 'todo_skip',
+                          reason    => 'i need both'
+                        };
+
+for ($start_test..$Test->current_test) { print "ok $_\n" }
+$Test->output($out_fh);
+$Test->todo_output($todo_fh);
+
+$Test->is_num( scalar $Test->summary(), 4,   'summary' );
+push @Expected_Details, { 'ok'      => 1,
+                          actual_ok => 1,
+                          name      => 'summary',
+                          type      => '',
+                          reason    => '',
+                        };
+
+$Test->current_test(6);
+print "ok 6 - current_test incremented\n";
+push @Expected_Details, { 'ok'      => 1,
+                          actual_ok => undef,
+                          name      => undef,
+                          type      => 'unknown',
+                          reason    => 'incrementing test number',
+                        };
+
+my @details = $Test->details();
+$Test->is_num( scalar @details, 6,
+    'details() should return a list of all test details');
+
+$Test->level(1);
+is_deeply( \@details, \@Expected_Details );
+
+
+# This test has to come last because it thrashes the test details.
+{
+    my $curr_test = $Test->current_test;
+    $Test->current_test(4);
+    my @details = $Test->details();
+
+    $Test->current_test($curr_test);
+    $Test->is_num( scalar @details, 4 );
+}

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/details.t
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/diag.t
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/diag.t?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/diag.t (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/diag.t Tue May 17 14:38:00 2005
@@ -0,0 +1,72 @@
+#!perl -w
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = ('../lib', 'lib');
+    }
+    else {
+        unshift @INC, 't/lib';
+    }
+}
+
+
+# Turn on threads here, if available, since this test tends to find
+# lots of threading bugs.
+use Config;
+BEGIN {
+    if( $] >= 5.008 && $Config{useithreads} ) {
+        require threads;
+        'threads'->import;
+    }
+}
+
+
+use strict;
+
+use Test::More tests => 5;
+
+my $Test = Test::More->builder;
+
+# now make a filehandle where we can send data
+use TieOut;
+my $output = tie *FAKEOUT, 'TieOut';
+
+# force diagnostic output to a filehandle, glad I added this to
+# Test::Builder :)
+my $ret;
+{
+    local $TODO = 1;
+    $Test->todo_output(\*FAKEOUT);
+
+    diag("a single line");
+
+    $ret = diag("multiple\n", "lines");
+}
+
+is( $output->read, <<'DIAG',   'diag() with todo_output set' );
+# a single line
+# multiple
+# lines
+DIAG
+
+ok( !$ret, 'diag returns false' );
+
+{
+    $Test->failure_output(\*FAKEOUT);
+    $ret = diag("# foo");
+}
+$Test->failure_output(\*STDERR);
+is( $output->read, "# # foo\n", "diag() adds # even if there's one already" );
+ok( !$ret,  'diag returns false' );
+
+
+# [rt.cpan.org 8392]
+{
+    $Test->failure_output(\*FAKEOUT);
+    diag(qw(one two));
+}
+$Test->failure_output(\*STDERR);
+is( $output->read, <<'DIAG' );
+# onetwo
+DIAG

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/diag.t
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/eq_set.t
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/eq_set.t?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/eq_set.t (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/eq_set.t Tue May 17 14:38:00 2005
@@ -0,0 +1,21 @@
+#!perl -w
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = ('../lib', 'lib');
+    }
+    else {
+        unshift @INC, 't/lib';
+    }
+}
+chdir 't';
+
+use strict;
+use Test::More;
+
+plan tests => 2;
+
+# RT 3747
+ok( eq_set([1, 2, [3]], [[3], 1, 2]) );
+ok( eq_set([1,2,[3]], [1,[3],2]) );

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/eq_set.t
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/exit.t
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/exit.t?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/exit.t (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/exit.t Tue May 17 14:38:00 2005
@@ -0,0 +1,104 @@
+#!/usr/bin/perl -w
+
+# Can't use Test.pm, that's a 5.005 thing.
+package My::Test;
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = '../lib';
+    }
+}
+
+unless( eval { require File::Spec } ) {
+    print "1..0 # Skip Need File::Spec to run this test\n";
+    exit 0;
+}
+
+if( $^O eq 'VMS' && $] <= 5.00503 ) {
+    print "1..0 # Skip test will hang on older VMS perls\n";
+    exit 0;
+}
+
+if( $^O eq 'MacOS' ) {
+    print "1..0 # Skip exit status broken on Mac OS\n";
+    exit 0;
+}
+
+my $test_num = 1;
+# Utility testing functions.
+sub ok ($;$) {
+    my($test, $name) = @_;
+    my $ok = '';
+    $ok .= "not " unless $test;
+    $ok .= "ok $test_num";
+    $ok .= " - $name" if defined $name;
+    $ok .= "\n";
+    print $ok;
+    $test_num++;
+}
+
+
+package main;
+
+my $IsVMS = $^O eq 'VMS';
+
+print "# Ahh!  I see you're running VMS.\n" if $IsVMS;
+
+my %Tests = (
+             #                      Everyone Else   VMS
+             'success.plx'              => [0,      0],
+             'one_fail.plx'             => [1,      4],
+             'two_fail.plx'             => [2,      4],
+             'five_fail.plx'            => [5,      4],
+             'extras.plx'               => [3,      4],
+             'too_few.plx'              => [4,      4],
+             'death.plx'                => [255,    4],
+             'last_minute_death.plx'    => [255,    4],
+             'pre_plan_death.plx'       => ['not zero',    'not zero'],
+             'death_in_eval.plx'        => [0,      0],
+             'require.plx'              => [0,      0],
+	     'exit.plx'                 => [1,      4],
+            );
+
+print "1..".keys(%Tests)."\n";
+
+eval { require POSIX; &POSIX::WEXITSTATUS(0) };
+if( $@ ) {
+    *exitstatus = sub { $_[0] >> 8 };
+}
+else {
+    *exitstatus = sub { POSIX::WEXITSTATUS($_[0]) }
+}
+
+chdir 't';
+my $lib = File::Spec->catdir(qw(lib Test Simple sample_tests));
+while( my($test_name, $exit_codes) = each %Tests ) {
+    my($exit_code) = $exit_codes->[$IsVMS ? 1 : 0];
+
+    my $Perl = $^X;
+
+    if( $^O eq 'VMS' ) {
+        # VMS can't use its own $^X in a system call until almost 5.8
+        $Perl = "MCR $^X" if $] < 5.007003;
+
+        # Quiet noisy 'SYS$ABORT'.  'hushed' only exists in 5.6 and up,
+        # but it doesn't do any harm on eariler perls.
+        $Perl .= q{ -"Mvmsish=hushed"};
+    }
+
+    my $file = File::Spec->catfile($lib, $test_name);
+    my $wait_stat = system(qq{$Perl -"I../blib/lib" -"I../lib" -"I../t/lib" $file});
+    my $actual_exit = exitstatus($wait_stat);
+
+    if( $exit_code eq 'not zero' ) {
+        My::Test::ok( $actual_exit != 0,
+                      "$test_name exited with $actual_exit ".
+                      "(expected $exit_code)");
+    }
+    else {
+        My::Test::ok( $actual_exit == $exit_code, 
+                      "$test_name exited with $actual_exit ".
+                      "(expected $exit_code)");
+    }
+}

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/exit.t
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/extra.t
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/extra.t?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/extra.t (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/extra.t Tue May 17 14:38:00 2005
@@ -0,0 +1,65 @@
+#!perl -w
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = '../lib';
+    }
+}
+
+# Can't use Test.pm, that's a 5.005 thing.
+package My::Test;
+
+print "1..2\n";
+
+my $test_num = 1;
+# Utility testing functions.
+sub ok ($;$) {
+    my($test, $name) = @_;
+    my $ok = '';
+    $ok .= "not " unless $test;
+    $ok .= "ok $test_num";
+    $ok .= " - $name" if defined $name;
+    $ok .= "\n";
+    print $ok;
+    $test_num++;
+}
+
+
+package main;
+
+require Test::Simple;
+
+chdir 't';
+push @INC, '../t/lib/';
+require Test::Simple::Catch;
+my($out, $err) = Test::Simple::Catch::caught();
+local $ENV{HARNESS_ACTIVE} = 0;
+
+Test::Simple->import(tests => 3);
+
+#line 30
+ok(1, 'Foo');
+ok(0, 'Bar');
+ok(1, 'Yar');
+ok(1, 'Car');
+ok(0, 'Sar');
+
+END {
+    My::Test::ok($$out eq <<OUT);
+1..3
+ok 1 - Foo
+not ok 2 - Bar
+ok 3 - Yar
+ok 4 - Car
+not ok 5 - Sar
+OUT
+
+    My::Test::ok($$err eq <<ERR);
+#     Failed test ($0 at line 31)
+#     Failed test ($0 at line 34)
+# Looks like you planned 3 tests but ran 2 extra.
+ERR
+
+    exit 0;
+}

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/extra.t
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/extra_one.t
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/extra_one.t?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/extra_one.t (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/extra_one.t Tue May 17 14:38:00 2005
@@ -0,0 +1,59 @@
+#!/usr/bin/perl -w
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = ('../lib', 'lib');
+    }
+    else {
+        unshift @INC, 't/lib';
+    }
+}
+
+use strict;
+
+require Test::Simple::Catch;
+my($out, $err) = Test::Simple::Catch::caught();
+
+# Can't use Test.pm, that's a 5.005 thing.
+package My::Test;
+
+print "1..2\n";
+
+my $test_num = 1;
+# Utility testing functions.
+sub ok ($;$) {
+    my($test, $name) = @_;
+    my $ok = '';
+    $ok .= "not " unless $test;
+    $ok .= "ok $test_num";
+    $ok .= " - $name" if defined $name;
+    $ok .= "\n";
+    print $ok;
+    $test_num++;
+}
+
+
+package main;
+
+require Test::Simple;
+Test::Simple->import(tests => 1);
+ok(1);
+ok(1);
+ok(1);
+
+END {
+    My::Test::ok($$out eq <<OUT);
+1..1
+ok 1
+ok 2
+ok 3
+OUT
+
+    My::Test::ok($$err eq <<ERR);
+# Looks like you planned 1 test but ran 2 extra.
+ERR
+
+    # Prevent Test::Simple from existing with non-zero
+    exit 0;
+}

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/extra_one.t
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/fail-like.t
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/fail-like.t?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/fail-like.t (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/fail-like.t Tue May 17 14:38:00 2005
@@ -0,0 +1,74 @@
+# qr// was introduced in 5.004-devel.  Skip this test if we're not
+# of high enough version.
+BEGIN { 
+    if( $] < 5.005 ) {
+        print "1..0 # Skipped Test requires qr//\n";
+        exit(0);
+    }
+}
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = ('../lib', 'lib');
+    }
+    else {
+        unshift @INC, 't/lib';
+    }
+}
+
+# There was a bug with like() involving a qr// not failing properly.
+# This tests against that.
+
+use strict;
+
+require Test::Simple::Catch;
+my($out, $err) = Test::Simple::Catch::caught();
+local $ENV{HARNESS_ACTIVE} = 0;
+
+
+# Can't use Test.pm, that's a 5.005 thing.
+package My::Test;
+
+print "1..2\n";
+
+my $test_num = 1;
+# Utility testing functions.
+sub ok ($;$) {
+    my($test, $name) = @_;
+    my $ok = '';
+    $ok .= "not " unless $test;
+    $ok .= "ok $test_num";
+    $ok .= " - $name" if defined $name;
+    $ok .= "\n";
+    print $ok;
+    $test_num++;
+}
+
+
+package main;
+
+require Test::More;
+Test::More->import(tests => 1);
+
+eval q{ like( "foo", qr/that/, 'is foo like that' ); };
+
+
+END {
+    My::Test::ok($$out eq <<OUT, 'failing output');
+1..1
+not ok 1 - is foo like that
+OUT
+
+    my $err_re = <<ERR;
+#     Failed test \\(.*\\)
+#                   'foo'
+#     doesn't match '\\(\\?-xism:that\\)'
+# Looks like you failed 1 test of 1\\.
+ERR
+
+
+    My::Test::ok($$err =~ /^$err_re$/, 'failing errors');
+
+    exit(0);
+}

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/fail-like.t
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/fail-more.t
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/fail-more.t?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/fail-more.t (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/fail-more.t Tue May 17 14:38:00 2005
@@ -0,0 +1,272 @@
+#!perl -w
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = ('../lib', 'lib');
+    }
+    else {
+        unshift @INC, 't/lib';
+    }
+}
+
+use strict;
+
+require Test::Simple::Catch;
+my($out, $err) = Test::Simple::Catch::caught();
+local $ENV{HARNESS_ACTIVE} = 0;
+
+
+# Can't use Test.pm, that's a 5.005 thing.
+package My::Test;
+
+print "1..12\n";
+
+my $test_num = 1;
+# Utility testing functions.
+sub ok ($;$) {
+    my($test, $name) = @_;
+    my $ok = '';
+    $ok .= "not " unless $test;
+    $ok .= "ok $test_num";
+    $ok .= " - $name" if defined $name;
+    $ok .= "\n";
+    print $ok;
+    $test_num++;
+
+    return $test;
+}
+
+
+sub main::err_ok ($) {
+    my($expect) = @_;
+    my $got = $err->read;
+
+    my $ok = ok( $got eq $expect );
+
+    unless( $ok ) {
+        print STDERR "$got\n";
+        print STDERR "$expect\n";
+    }
+
+    return $ok;
+}
+
+
+package main;
+
+require Test::More;
+my $Total = 29;
+Test::More->import(tests => $Total);
+
+my $tb = Test::More->builder;
+$tb->use_numbers(0);
+
+# Preserve the line numbers.
+#line 38
+ok( 0, 'failing' );
+err_ok( <<ERR );
+#     Failed test ($0 at line 38)
+ERR
+
+#line 40
+is( "foo", "bar", 'foo is bar?');
+is( undef, '',    'undef is empty string?');
+is( undef, 0,     'undef is 0?');
+is( '',    0,     'empty string is 0?' );
+err_ok( <<ERR );
+#     Failed test ($0 at line 40)
+#          got: 'foo'
+#     expected: 'bar'
+#     Failed test ($0 at line 41)
+#          got: undef
+#     expected: ''
+#     Failed test ($0 at line 42)
+#          got: undef
+#     expected: '0'
+#     Failed test ($0 at line 43)
+#          got: ''
+#     expected: '0'
+ERR
+
+#line 45
+isnt("foo", "foo", 'foo isnt foo?' );
+isn't("foo", "foo",'foo isn\'t foo?' );
+isnt(undef, undef, 'undef isnt undef?');
+err_ok( <<ERR );
+#     Failed test ($0 at line 45)
+#     'foo'
+#         ne
+#     'foo'
+#     Failed test ($0 at line 46)
+#     'foo'
+#         ne
+#     'foo'
+#     Failed test ($0 at line 47)
+#     undef
+#         ne
+#     undef
+ERR
+
+#line 48
+like( "foo", '/that/',  'is foo like that' );
+unlike( "foo", '/foo/', 'is foo unlike foo' );
+err_ok( <<ERR );
+#     Failed test ($0 at line 48)
+#                   'foo'
+#     doesn't match '/that/'
+#     Failed test ($0 at line 49)
+#                   'foo'
+#           matches '/foo/'
+ERR
+
+# Nick Clark found this was a bug.  Fixed in 0.40.
+like( "bug", '/(%)/',   'regex with % in it' );
+err_ok( <<ERR );
+#     Failed test ($0 at line 60)
+#                   'bug'
+#     doesn't match '/(%)/'
+ERR
+
+fail('fail()');
+err_ok( <<ERR );
+#     Failed test ($0 at line 67)
+ERR
+
+#line 52
+can_ok('Mooble::Hooble::Yooble', qw(this that));
+can_ok('Mooble::Hooble::Yooble', ());
+err_ok( <<ERR );
+#     Failed test ($0 at line 52)
+#     Mooble::Hooble::Yooble->can('this') failed
+#     Mooble::Hooble::Yooble->can('that') failed
+#     Failed test ($0 at line 53)
+#     can_ok() called with no methods
+ERR
+
+#line 55
+isa_ok(bless([], "Foo"), "Wibble");
+isa_ok(42,    "Wibble", "My Wibble");
+isa_ok(undef, "Wibble", "Another Wibble");
+isa_ok([],    "HASH");
+err_ok( <<ERR );
+#     Failed test ($0 at line 55)
+#     The object isn't a 'Wibble' it's a 'Foo'
+#     Failed test ($0 at line 56)
+#     My Wibble isn't a reference
+#     Failed test ($0 at line 57)
+#     Another Wibble isn't defined
+#     Failed test ($0 at line 58)
+#     The object isn't a 'HASH' it's a 'ARRAY'
+ERR
+
+#line 68
+cmp_ok( 'foo', 'eq', 'bar', 'cmp_ok eq' );
+cmp_ok( 42.1,  '==', 23,  , '       ==' );
+cmp_ok( 42,    '!=', 42   , '       !=' );
+cmp_ok( 1,     '&&', 0    , '       &&' );
+cmp_ok( 42,    '==', "foo", '       == with strings' );
+cmp_ok( 42,    'eq', "foo", '       eq with numbers' );
+cmp_ok( undef, 'eq', 'foo', '       eq with undef' );
+err_ok( <<ERR );
+#     Failed test ($0 at line 68)
+#          got: 'foo'
+#     expected: 'bar'
+#     Failed test ($0 at line 69)
+#          got: 42.1
+#     expected: 23
+#     Failed test ($0 at line 70)
+#     '42'
+#         !=
+#     '42'
+#     Failed test ($0 at line 71)
+#     '1'
+#         &&
+#     '0'
+#     Failed test ($0 at line 72)
+#          got: 42
+#     expected: 0
+#     Failed test ($0 at line 73)
+#          got: '42'
+#     expected: 'foo'
+#     Failed test ($0 at line 74)
+#          got: undef
+#     expected: 'foo'
+ERR
+
+# generate a $!, it changes its value by context.
+-e "wibblehibble";
+my $Errno_Number = $!+0;
+my $Errno_String = $!.'';
+#line 80
+cmp_ok( $!,    'eq', '',    '       eq with stringified errno' );
+cmp_ok( $!,    '==', -1,    '       eq with numerified errno' );
+err_ok( <<ERR );
+#     Failed test ($0 at line 80)
+#          got: '$Errno_String'
+#     expected: ''
+#     Failed test ($0 at line 81)
+#          got: $Errno_Number
+#     expected: -1
+ERR
+
+#line 84
+use_ok('Hooble::mooble::yooble');
+require_ok('ALL::YOUR::BASE::ARE::BELONG::TO::US::wibble');
+
+#line 88
+END {
+    My::Test::ok($$out eq <<OUT, 'failing output');
+1..$Total
+not ok - failing
+not ok - foo is bar?
+not ok - undef is empty string?
+not ok - undef is 0?
+not ok - empty string is 0?
+not ok - foo isnt foo?
+not ok - foo isn't foo?
+not ok - undef isnt undef?
+not ok - is foo like that
+not ok - is foo unlike foo
+not ok - regex with % in it
+not ok - fail()
+not ok - Mooble::Hooble::Yooble->can(...)
+not ok - Mooble::Hooble::Yooble->can(...)
+not ok - The object isa Wibble
+not ok - My Wibble isa Wibble
+not ok - Another Wibble isa Wibble
+not ok - The object isa HASH
+not ok - cmp_ok eq
+not ok -        ==
+not ok -        !=
+not ok -        &&
+not ok -        == with strings
+not ok -        eq with numbers
+not ok -        eq with undef
+not ok -        eq with stringified errno
+not ok -        eq with numerified errno
+not ok - use Hooble::mooble::yooble;
+not ok - require ALL::YOUR::BASE::ARE::BELONG::TO::US::wibble;
+OUT
+
+   my $filename = quotemeta $0;
+   my $more_err_re = <<ERR;
+#     Failed test \\($filename at line 84\\)
+#     Tried to use 'Hooble::mooble::yooble'.
+#     Error:  Can't locate Hooble.* in \\\@INC .*
+# BEGIN failed--compilation aborted at $filename line 84.
+#     Failed test \\($filename at line 85\\)
+#     Tried to require 'ALL::YOUR::BASE::ARE::BELONG::TO::US::wibble'.
+#     Error:  Can't locate ALL.* in \\\@INC .*
+# Looks like you failed $Total tests of $Total.
+ERR
+
+    unless( My::Test::ok($$err =~ /^$more_err_re$/, 
+                         'failing errors') ) {
+        print $$err;
+        print "regex:\n";
+        print $more_err_re;
+    }
+
+    exit(0);
+}

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/fail-more.t
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/fail.t
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/fail.t?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/fail.t (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/fail.t Tue May 17 14:38:00 2005
@@ -0,0 +1,70 @@
+#!perl -w
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = ('../lib', 'lib');
+    }
+    else {
+        unshift @INC, 't/lib';
+    }
+}
+
+use strict;
+
+require Test::Simple::Catch;
+my($out, $err) = Test::Simple::Catch::caught();
+local $ENV{HARNESS_ACTIVE} = 0;
+
+
+# Can't use Test.pm, that's a 5.005 thing.
+package My::Test;
+
+print "1..2\n";
+
+my $test_num = 1;
+# Utility testing functions.
+sub ok ($;$) {
+    my($test, $name) = @_;
+    my $ok = '';
+    $ok .= "not " unless $test;
+    $ok .= "ok $test_num";
+    $ok .= " - $name" if defined $name;
+    $ok .= "\n";
+    print $ok;
+    $test_num++;
+}
+
+
+package main;
+
+require Test::Simple;
+Test::Simple->import(tests => 5);
+
+#line 35
+ok( 1, 'passing' );
+ok( 2, 'passing still' );
+ok( 3, 'still passing' );
+ok( 0, 'oh no!' );
+ok( 0, 'damnit' );
+
+
+END {
+    My::Test::ok($$out eq <<OUT);
+1..5
+ok 1 - passing
+ok 2 - passing still
+ok 3 - still passing
+not ok 4 - oh no!
+not ok 5 - damnit
+OUT
+
+    My::Test::ok($$err eq <<ERR);
+#     Failed test ($0 at line 38)
+#     Failed test ($0 at line 39)
+# Looks like you failed 2 tests of 5.
+ERR
+
+    # Prevent Test::Simple from exiting with non zero
+    exit 0;
+}

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/fail.t
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/fail_one.t
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/fail_one.t?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/fail_one.t (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/fail_one.t Tue May 17 14:38:00 2005
@@ -0,0 +1,62 @@
+#!/usr/bin/perl -w
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = ('../lib', 'lib');
+    }
+    else {
+        unshift @INC, 't/lib';
+    }
+}
+
+use strict;
+
+require Test::Simple::Catch;
+my($out, $err) = Test::Simple::Catch::caught();
+local $ENV{HARNESS_ACTIVE} = 0;
+
+
+# Can't use Test.pm, that's a 5.005 thing.
+package My::Test;
+
+print "1..2\n";
+
+my $test_num = 1;
+# Utility testing functions.
+sub ok ($;$) {
+    my($test, $name) = @_;
+    my $ok = '';
+    $ok .= "not " unless $test;
+    $ok .= "ok $test_num";
+    $ok .= " - $name" if defined $name;
+    $ok .= "\n";
+    print $ok;
+    $test_num++;
+
+    return $test ? 1 : 0;
+}
+
+
+package main;
+
+require Test::Simple;
+Test::Simple->import(tests => 1);
+
+#line 45
+ok(0);
+
+END {
+    My::Test::ok($$out eq <<OUT);
+1..1
+not ok 1
+OUT
+
+    My::Test::ok($$err eq <<ERR) || print $$err;
+#     Failed test ($0 at line 45)
+# Looks like you failed 1 test of 1.
+ERR
+
+    # Prevent Test::Simple from existing with non-zero
+    exit 0;
+}

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/fail_one.t
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/filehandles.t
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/filehandles.t?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/filehandles.t (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/filehandles.t Tue May 17 14:38:00 2005
@@ -0,0 +1,21 @@
+#!perl -w
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = '../lib';
+    }
+}
+
+use Test::More tests => 1;
+
+tie *STDOUT, "Dev::Null" or die $!;
+
+print "not ok 1\n";     # this should not print.
+pass 'STDOUT can be mucked with';
+
+
+package Dev::Null;
+
+sub TIEHANDLE { bless {} }
+sub PRINT { 1 }

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/filehandles.t
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/fork.t
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/fork.t?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/fork.t (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/fork.t Tue May 17 14:38:00 2005
@@ -0,0 +1,32 @@
+#!/usr/bin/perl -w
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = '../lib';
+    }
+}
+
+use Test::More;
+use Config;
+
+my $Can_Fork = $Config{d_fork} ||
+               (($^O eq 'MSWin32' || $^O eq 'NetWare') and
+                $Config{useithreads} and 
+                $Config{ccflags} =~ /-DPERL_IMPLICIT_SYS/
+               );
+
+if( !$Can_Fork ) {
+    plan skip_all => "This system cannot fork";
+}
+else {
+    plan tests => 1;
+}
+
+if( fork ) { # parent
+    pass("Only the parent should process the ending, not the child");
+}
+else {
+    exit;   # child
+}
+

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/fork.t
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/harness_active.t
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/harness_active.t?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/harness_active.t (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/harness_active.t Tue May 17 14:38:00 2005
@@ -0,0 +1,99 @@
+#!perl -w
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = ('../lib', 'lib');
+    }
+    else {
+        unshift @INC, 't/lib';
+    }
+}
+
+use strict;
+
+use Test::Simple::Catch;
+my($out, $err) = Test::Simple::Catch::caught();
+
+
+# Can't use Test.pm, that's a 5.005 thing.
+package My::Test;
+
+print "1..4\n";
+
+my $test_num = 1;
+# Utility testing functions.
+sub ok ($;$) {
+    my($test, $name) = @_;
+    my $ok = '';
+    $ok .= "not " unless $test;
+    $ok .= "ok $test_num";
+    $ok .= " - $name" if defined $name;
+    $ok .= "\n";
+    print $ok;
+    $test_num++;
+
+    return $test;
+}
+
+
+sub main::err_ok ($) {
+    my($expect) = @_;
+    my $got = $err->read;
+
+    my $ok = ok( $got eq $expect );
+
+    unless( $ok ) {
+        print STDERR "got\n$got\n";
+        print STDERR "expected\n$expect\n";
+    }
+
+    return $ok;
+}
+
+
+package main;
+
+require Test::More;
+Test::More->import(tests => 4);
+Test::More->builder->no_ending(1);
+
+{
+    local $ENV{HARNESS_ACTIVE} = 0;
+
+#line 62
+    fail( "this fails" );
+    err_ok( <<ERR );
+#     Failed test ($0 at line 62)
+ERR
+
+#line 72
+    is( 1, 0 );
+    err_ok( <<ERR );
+#     Failed test ($0 at line 72)
+#          got: '1'
+#     expected: '0'
+ERR
+}
+
+{
+    local $ENV{HARNESS_ACTIVE} = 1;
+                   
+#line 71
+    fail( "this fails" );
+    err_ok( <<ERR );
+
+#     Failed test ($0 at line 71)
+ERR
+
+
+#line 84
+    is( 1, 0 );
+    err_ok( <<ERR );
+
+#     Failed test ($0 at line 84)
+#          got: '1'
+#     expected: '0'
+ERR
+
+}

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/harness_active.t
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/has_plan.t
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/has_plan.t?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/has_plan.t (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/has_plan.t Tue May 17 14:38:00 2005
@@ -0,0 +1,23 @@
+#!/usr/bin/perl -w
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = ('../lib');
+    }
+}
+
+use strict;
+use Test::Builder;
+
+my $unplanned;
+
+BEGIN {
+	$unplanned = 'oops';
+	$unplanned = Test::Builder->new->has_plan;
+};
+
+use Test::More tests => 2;
+
+is($unplanned, undef, 'no plan yet defined');
+is(Test::Builder->new->has_plan, 2, 'has fixed plan');

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/has_plan.t
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/has_plan2.t
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/has_plan2.t?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/has_plan2.t (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/has_plan2.t Tue May 17 14:38:00 2005
@@ -0,0 +1,34 @@
+#!/usr/bin/perl -w
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = '../lib';
+    }
+}
+
+use Test::More;
+
+BEGIN {
+    if( !$ENV{HARNESS_ACTIVE} && $ENV{PERL_CORE} ) {
+        plan skip_all => "Won't work with t/TEST";
+    }
+}
+
+BEGIN {
+    require Test::Harness;
+}
+
+# This feature requires a fairly new version of Test::Harness
+if( $Test::Harness::VERSION < 2.03 ) {
+    plan tests => 1;
+    diag "Need Test::Harness 2.03 or up.  You have $Test::Harness::VERSION.";
+    fail 'Need Test::Harness 2.03 or up';
+    exit;
+}
+
+use strict;
+use Test::Builder;
+
+plan 'no_plan';
+is(Test::Builder->new->has_plan, 'no_plan', 'has no_plan');

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/has_plan2.t
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/import.t
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/import.t?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/import.t (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/import.t Tue May 17 14:38:00 2005
@@ -0,0 +1,12 @@
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = '../lib';
+    }
+}
+
+
+use Test::More tests => 2, import => [qw(!fail)];
+
+can_ok(__PACKAGE__, qw(ok pass like isa_ok));
+ok( !__PACKAGE__->can('fail'),  'fail() not exported' );

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/import.t
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/is_deeply_fail.t
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/is_deeply_fail.t?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/is_deeply_fail.t (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/is_deeply_fail.t Tue May 17 14:38:00 2005
@@ -0,0 +1,332 @@
+#!/usr/bin/perl -w
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = ('../lib', 'lib');
+    }
+    else {
+        unshift @INC, 't/lib';
+    }
+}
+
+use strict;
+
+use Test::Builder;
+require Test::Simple::Catch;
+my($out, $err) = Test::Simple::Catch::caught();
+Test::Builder->new->no_header(1);
+Test::Builder->new->no_ending(1);
+local $ENV{HARNESS_ACTIVE} = 0;
+
+
+# Can't use Test.pm, that's a 5.005 thing.
+package main;
+
+
+my $TB = Test::Builder->create;
+$TB->plan(tests => 67);
+
+# Utility testing functions.
+sub ok ($;$) {
+    return $TB->ok(@_);
+}
+
+sub is ($$;$) {
+    my($this, $that, $name) = @_;
+
+    my $ok = $TB->is_eq($$this, $that, $name);
+
+    $$this = '';
+
+    return $ok;
+}
+
+sub like ($$;$) {
+    my($this, $regex, $name) = @_;
+    $regex = qr/$regex/ unless ref $regex;
+
+    my $ok = $TB->like($$this, $regex, $name);
+
+    $$this = '';
+
+    return $ok;
+}
+
+
+require Test::More;
+Test::More->import(tests => 11, import => ['is_deeply']);
+
+my $Filename = quotemeta $0;
+
+#line 68
+ok !is_deeply('foo', 'bar', 'plain strings');
+is( $out, "not ok 1 - plain strings\n",     'plain strings' );
+is( $err, <<ERR,                            '    right diagnostic' );
+#     Failed test ($0 at line 68)
+#          got: 'foo'
+#     expected: 'bar'
+ERR
+
+
+#line 78
+ok !is_deeply({}, [], 'different types');
+is( $out, "not ok 2 - different types\n",   'different types' );
+like( $err, <<ERR,                          '   right diagnostic' );
+#     Failed test \\($Filename at line 78\\)
+#     Structures begin differing at:
+#          \\\$got = HASH\\(0x[0-9a-f]+\\)
+#     \\\$expected = ARRAY\\(0x[0-9a-f]+\\)
+ERR
+
+#line 88
+ok !is_deeply({ this => 42 }, { this => 43 }, 'hashes with different values');
+is( $out, "not ok 3 - hashes with different values\n", 
+                                        'hashes with different values' );
+is( $err, <<ERR,                        '   right diagnostic' );
+#     Failed test ($0 at line 88)
+#     Structures begin differing at:
+#          \$got->{this} = '42'
+#     \$expected->{this} = '43'
+ERR
+
+#line 99
+ok !is_deeply({ that => 42 }, { this => 42 }, 'hashes with different keys');
+is( $out, "not ok 4 - hashes with different keys\n",
+                                        'hashes with different keys' );
+is( $err, <<ERR,                        '    right diagnostic' );
+#     Failed test ($0 at line 99)
+#     Structures begin differing at:
+#          \$got->{this} = Does not exist
+#     \$expected->{this} = '42'
+ERR
+
+#line 110
+ok !is_deeply([1..9], [1..10],    'arrays of different length');
+is( $out, "not ok 5 - arrays of different length\n",
+                                        'arrays of different length' );
+is( $err, <<ERR,                        '    right diagnostic' );
+#     Failed test ($0 at line 110)
+#     Structures begin differing at:
+#          \$got->[9] = Does not exist
+#     \$expected->[9] = '10'
+ERR
+
+#line 121
+ok !is_deeply([undef, undef], [undef], 'arrays of undefs' );
+is( $out, "not ok 6 - arrays of undefs\n",  'arrays of undefs' );
+is( $err, <<ERR,                            '    right diagnostic' );
+#     Failed test ($0 at line 121)
+#     Structures begin differing at:
+#          \$got->[1] = undef
+#     \$expected->[1] = Does not exist
+ERR
+
+#line 131
+ok !is_deeply({ foo => undef }, {},    'hashes of undefs' );
+is( $out, "not ok 7 - hashes of undefs\n",  'hashes of undefs' );
+is( $err, <<ERR,                            '    right diagnostic' );
+#     Failed test ($0 at line 131)
+#     Structures begin differing at:
+#          \$got->{foo} = undef
+#     \$expected->{foo} = Does not exist
+ERR
+
+#line 141
+ok !is_deeply(\42, \23,   'scalar refs');
+is( $out, "not ok 8 - scalar refs\n",   'scalar refs' );
+is( $err, <<ERR,                        '    right diagnostic' );
+#     Failed test ($0 at line 141)
+#     Structures begin differing at:
+#     \${     \$got} = '42'
+#     \${\$expected} = '23'
+ERR
+
+#line 151
+ok !is_deeply([], \23,    'mixed scalar and array refs');
+is( $out, "not ok 9 - mixed scalar and array refs\n",
+                                        'mixed scalar and array refs' );
+like( $err, <<ERR,                      '    right diagnostic' );
+#     Failed test \\($Filename at line 151\\)
+#     Structures begin differing at:
+#          \\\$got = ARRAY\\(0x[0-9a-f]+\\)
+#     \\\$expected = SCALAR\\(0x[0-9a-f]+\\)
+ERR
+
+
+my($a1, $a2, $a3);
+$a1 = \$a2;  $a2 = \$a3;
+$a3 = 42;
+
+my($b1, $b2, $b3);
+$b1 = \$b2;  $b2 = \$b3;
+$b3 = 23;
+
+#line 173
+ok !is_deeply($a1, $b1, 'deep scalar refs');
+is( $out, "not ok 10 - deep scalar refs\n",     'deep scalar refs' );
+is( $err, <<ERR,                              '    right diagnostic' );
+#     Failed test ($0 at line 173)
+#     Structures begin differing at:
+#     \${\${     \$got}} = '42'
+#     \${\${\$expected}} = '23'
+ERR
+
+# I don't know how to properly display this structure.
+# $a2 = { foo => \$a3 };
+# $b2 = { foo => \$b3 };
+# is_deeply([$a1], [$b1], 'deep mixed scalar refs');
+
+my $foo = {
+           this => [1..10],
+           that => { up => "down", left => "right" },
+          };
+
+my $bar = {
+           this => [1..10],
+           that => { up => "down", left => "right", foo => 42 },
+          };
+
+#line 198
+ok !is_deeply( $foo, $bar, 'deep structures' );
+ok( @Test::More::Data_Stack == 0, '@Data_Stack not holding onto things' );
+is( $out, "not ok 11 - deep structures\n",  'deep structures' );
+is( $err, <<ERR,                            '    right diagnostic' );
+#     Failed test ($0 at line 198)
+#     Structures begin differing at:
+#          \$got->{that}{foo} = Does not exist
+#     \$expected->{that}{foo} = '42'
+ERR
+
+
+#line 221
+my @tests = ([],
+             [qw(42)],
+             [qw(42 23), qw(42 23)]
+            );
+
+foreach my $test (@tests) {
+    my $num_args = @$test;
+
+    my $warning;
+    local $SIG{__WARN__} = sub { $warning .= join '', @_; };
+    ok !is_deeply(@$test);
+
+    like \$warning, 
+         qr/^is_deeply\(\) takes two or three args, you gave $num_args\.\n/;
+}
+
+
+#line 240
+# [rt.cpan.org 6837]
+ok !is_deeply([{Foo => undef}],[{Foo => ""}]), 'undef != ""';
+ok( @Test::More::Data_Stack == 0, '@Data_Stack not holding onto things' );
+
+
+#line 258
+# [rt.cpan.org 7031]
+my $a = [];
+ok !is_deeply($a, $a.''),       "don't compare refs like strings";
+ok !is_deeply([$a], [$a.'']),   "  even deep inside";
+
+
+#line 265
+# [rt.cpan.org 7030]
+ok !is_deeply( {}, {key => []} ),  '[] could match non-existent values';
+ok !is_deeply( [], [[]] );
+
+
+#line 273
+$$err = $$out = '';
+ok !is_deeply( [\'a', 'b'], [\'a', 'c'] );
+is( $out, "not ok 20\n",  'scalar refs in an array' );
+is( $err, <<ERR,        '    right diagnostic' );
+#     Failed test ($0 at line 274)
+#     Structures begin differing at:
+#          \$got->[1] = 'b'
+#     \$expected->[1] = 'c'
+ERR
+
+
+#line 285
+my $ref = \23;
+ok !is_deeply( 23, $ref );
+is( $out, "not ok 21\n", 'scalar vs ref' );
+is( $err, <<ERR,        '  right diagnostic');
+#     Failed test ($0 at line 286)
+#     Structures begin differing at:
+#          \$got = '23'
+#     \$expected = $ref
+ERR
+
+#line 296
+ok !is_deeply( $ref, 23 );
+is( $out, "not ok 22\n", 'ref vs scalar' );
+is( $err, <<ERR,        '  right diagnostic');
+#     Failed test ($0 at line 296)
+#     Structures begin differing at:
+#          \$got = $ref
+#     \$expected = '23'
+ERR
+
+#line 306
+ok !is_deeply( undef, [] );
+is( $out, "not ok 23\n", 'is_deeply and undef [RT 9441]' );
+like( $err, <<ERR,	 '  right diagnostic' );
+#     Failed test \\($Filename at line 306\\)
+#     Structures begin differing at:
+#          \\\$got = undef
+#     \\\$expected = ARRAY\\(0x[0-9a-f]+\\)
+ERR
+
+
+# rt.cpan.org 8865
+{
+    my $array = [];
+    my $hash  = {};
+
+#line 321
+    ok !is_deeply( $array, $hash );
+    is( $out, "not ok 24\n", 'is_deeply and different reference types' );
+    is( $err, <<ERR, 	     '  right diagnostic' );
+#     Failed test ($0 at line 321)
+#     Structures begin differing at:
+#          \$got = $array
+#     \$expected = $hash
+ERR
+
+#line 332
+    ok !is_deeply( [$array], [$hash] );
+    is( $out, "not ok 25\n", 'nested different ref types' );
+    is( $err, <<ERR,	     '  right diagnostic' );
+#     Failed test ($0 at line 332)
+#     Structures begin differing at:
+#          \$got->[0] = $array
+#     \$expected->[0] = $hash
+ERR
+
+
+    if( eval { require overload } ) {
+	my $foo = bless [], "Foo";
+	my $bar = bless {}, "Bar";
+
+	{
+	    package Bar;
+	    overload->import(q[""] => sub { "wibble" });
+	}
+
+#line 353
+	ok !is_deeply( [$foo], [$bar] );
+	is( $out, "not ok 26\n", 'string overloaded refs respected in diag' );
+	is( $err, <<ERR,	     '  right diagnostic' );
+#     Failed test ($0 at line 353)
+#     Structures begin differing at:
+#          \$got->[0] = $foo
+#     \$expected->[0] = 'wibble'
+ERR
+
+    }
+    else {
+	$TB->skip("Needs overload.pm") for 1..3;
+    }
+}

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/is_deeply_fail.t
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/is_fh.t
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/is_fh.t?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/is_fh.t (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/is_fh.t Tue May 17 14:38:00 2005
@@ -0,0 +1,29 @@
+#!/usr/bin/perl -w
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = ('../lib', 'lib');
+    }
+    else {
+        unshift @INC, 't/lib';
+    }
+}
+
+use strict;
+use Test::More tests => 8;
+use TieOut;
+
+ok( !Test::Builder::_is_fh("foo"), 'string is not a filehandle' );
+ok( !Test::Builder::_is_fh(''),    'empty string' );
+ok( !Test::Builder::_is_fh(undef), 'undef' );
+
+ok( open(FILE, '>foo') );
+END { close FILE; unlink 'foo' }
+
+ok( Test::Builder::_is_fh(*FILE) );
+ok( Test::Builder::_is_fh(\*FILE) );
+ok( Test::Builder::_is_fh(*FILE{IO}) );
+
+tie *OUT, 'TieOut';
+ok( Test::Builder::_is_fh(*OUT) );

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/is_fh.t
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/NoExporter.pm
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/NoExporter.pm?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/NoExporter.pm (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/NoExporter.pm Tue May 17 14:38:00 2005
@@ -0,0 +1,10 @@
+package NoExporter;
+
+$VERSION = 1.02;
+sub import { 
+    shift;
+    die "NoExporter exports nothing.  You asked for: @_" if @_;
+}
+
+1;
+

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/NoExporter.pm
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/Test/Simple/Catch.pm
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/Test/Simple/Catch.pm?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/Test/Simple/Catch.pm (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/Test/Simple/Catch.pm Tue May 17 14:38:00 2005
@@ -0,0 +1,18 @@
+# For testing Test::Simple;
+package Test::Simple::Catch;
+
+use Symbol;
+use TieOut;
+my($out_fh, $err_fh) = (gensym, gensym);
+my $out = tie *$out_fh, 'TieOut';
+my $err = tie *$err_fh, 'TieOut';
+
+use Test::Builder;
+my $t = Test::Builder->new;
+$t->output($out_fh);
+$t->failure_output($err_fh);
+$t->todo_output($err_fh);
+
+sub caught { return($out, $err) }
+
+1;

Propchange: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/Test/Simple/Catch.pm
------------------------------------------------------------------------------
    svn:eol-style = native

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/Test/Simple/sample_tests/death.plx
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/Test/Simple/sample_tests/death.plx?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/Test/Simple/sample_tests/death.plx (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/Test/Simple/sample_tests/death.plx Tue May 17 14:38:00 2005
@@ -0,0 +1,13 @@
+require Test::Simple;
+
+push @INC, 't/lib';
+require Test::Simple::Catch;
+my($out, $err) = Test::Simple::Catch::caught();
+
+Test::Simple->import(tests => 5);
+close STDERR;
+
+ok(1);
+ok(1);
+ok(1);
+die "Knife?";

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/Test/Simple/sample_tests/death_in_eval.plx
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/Test/Simple/sample_tests/death_in_eval.plx?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/Test/Simple/sample_tests/death_in_eval.plx (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/Test/Simple/sample_tests/death_in_eval.plx Tue May 17 14:38:00 2005
@@ -0,0 +1,22 @@
+require Test::Simple;
+use Carp;
+
+push @INC, 't/lib';
+require Test::Simple::Catch;
+my($out, $err) = Test::Simple::Catch::caught();
+
+Test::Simple->import(tests => 5);
+
+ok(1);
+ok(1);
+ok(1);
+eval {
+        die "Foo";
+};
+ok(1);
+eval "die 'Bar'";
+ok(1);
+
+eval {
+        croak "Moo";
+};

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/Test/Simple/sample_tests/exit.plx
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/Test/Simple/sample_tests/exit.plx?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/Test/Simple/sample_tests/exit.plx (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/Test/Simple/sample_tests/exit.plx Tue May 17 14:38:00 2005
@@ -0,0 +1,3 @@
+require Test::Builder;
+
+exit 1;

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/Test/Simple/sample_tests/extras.plx
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/Test/Simple/sample_tests/extras.plx?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/Test/Simple/sample_tests/extras.plx (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/Test/Simple/sample_tests/extras.plx Tue May 17 14:38:00 2005
@@ -0,0 +1,16 @@
+require Test::Simple;
+
+push @INC, 't/lib';
+require Test::Simple::Catch;
+my($out, $err) = Test::Simple::Catch::caught();
+
+Test::Simple->import(tests => 5);
+
+
+ok(1);
+ok(1);
+ok(1);
+ok(1);
+ok(0);
+ok(1);
+ok(0);

Added: perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/Test/Simple/sample_tests/five_fail.plx
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/Test/Simple/sample_tests/five_fail.plx?rev=170671&view=auto
==============================================================================
--- perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/Test/Simple/sample_tests/five_fail.plx (added)
+++ perl/Apache-Test/branches/test-more-unstable/Test-Simple/t/lib/Test/Simple/sample_tests/five_fail.plx Tue May 17 14:38:00 2005
@@ -0,0 +1,13 @@
+require Test::Simple;
+
+use lib 't/lib';
+require Test::Simple::Catch;
+my($out, $err) = Test::Simple::Catch::caught();
+
+Test::Simple->import(tests => 5);
+
+ok(0);
+ok(0);
+ok('');
+ok(0);
+ok(0);



Mime
View raw message