Re: Test::Harness in Test-SDK conflicts with Perl

2001-10-09 Thread Michael G Schwern

On Tue, Oct 09, 2001 at 08:59:48AM +0200, Johan Vromans wrote:
> > Debian. ;)
> 
> Actually, I was more thinking in terms of delivering perl not in one
> single rpm, but to have one rpm for barebones perl, and rpms for each
> of the individual core modules (or logical sets of core modules).

Debian has the beginnings of that.  perl-base is the minimum necessary
to have a useful Perl, basically a binary, the perl man page, and a
handful of critical modules (AutoLoader, Carp, Exporter, File::Spec,
IO, etc...).  There there's perl-doc which has all the man pages and
perldoc, perl-modules has all the rest of the core modules, perl-debug
is a binary with debugging flags on, perl-suid is suidperl, etc...

perl-modules could probably be cracked up into somewhat finer pieces
if anyone so desired.  The number of vigorously maintained core modules
on CPAN is currently pretty low.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]>   Kwalitee Is Job One
"His plagiarism was limited only by this faulty technique."
-- Peter Schickele



Re: testing web foo with Test::More

2001-10-09 Thread Shane Landrum

On Sun, Oct 07, 2001 at 03:30:58PM -0400, Kirrily 'Skud' Robert ([EMAIL PROTECTED]) 
wrote:
> OK, I've been putting off figuring this out for ages, but here it is:



Another way to accomplish the same thing, that I hacked up to
test an internal password-protected web gadget:


use strict;
use Test::More qw(no_plan);

use LWP::Simple;  
my $WEB_SYSTEM = 'foo.bar.com';
my $USERNAME = 'foo';
my $PASSWORD = 'bar';

use LWP::UserAgent;
# We make our own specialization of LWP::UserAgent that asks for
# user/password if document is protected.
{
package RequestAgent;
use base qw(LWP::UserAgent);

sub new
{ 
my $self = LWP::UserAgent::new(@_);
$self->agent("lwp-request/$VERSION");
$self;
}

sub get_basic_credentials
{
my($self, $realm, $uri) = @_;
return ($USERNAME, $PASSWORD);
}
}

my $url = "http://"; . $STORY_EDITOR . "/";
my $ua = RequestAgent->new;
my $request = HTTP::Request->new('GET', $url);
my $response = $ua->request($request);
ok($response->is_success,
"System is up and running at $WEB_SYSTEM" );
-

Far less elegant, but there it is. Suggestions welcome.

> I'm updating the Test::FAQ on the Wiki to show this.

Where's that Wiki again?

srl
-- 
Shane Landrum  (srl AT boston DOT com)  Software Engineer, boston.com  
   



Re: testing web foo with Test::More

2001-10-09 Thread Kirrily 'Skud' Robert

On Tue, Oct 09, 2001 at 09:17:06AM -0400, Shane Landrum wrote:
| On Sun, Oct 07, 2001 at 03:30:58PM -0400, Kirrily 'Skud' Robert ([EMAIL PROTECTED]) 
|wrote:
| > OK, I've been putting off figuring this out for ages, but here it is:
| 
| 
| 
| Another way to accomplish the same thing, that I hacked up to
| test an internal password-protected web gadget:

Well, WWW::Chat just gets pre-processed into LWP code.  But I like it
because it's at least an order of magnitude less LOC for anything more
than:

ok(LWP::Simple::get($url), "Get $url");

For instance, if you want to get a page, fill in a form, look at the
results, WWW::Chat is *definitely* your friend.  I'm about to start
using it with FormMagick.

K.




Re: Test::Harness in Test-SDK conflicts with Perl

2001-10-09 Thread Johan Vromans

Michael G Schwern <[EMAIL PROTECTED]> writes:

> Debian has the beginnings of that.  perl-base is the minimum necessary
> to have a useful Perl, basically a binary, the perl man page, and a
> handful of critical modules ...

Wouldn't it be a good idea to try to define packages like these, so
that packagers can all make consistent packages?

-- Johan



Re: Test::Harness in Test-SDK conflicts with Perl

2001-10-09 Thread Michael G Schwern

On Tue, Oct 09, 2001 at 10:10:33PM +0200, Johan Vromans wrote:
> Michael G Schwern <[EMAIL PROTECTED]> writes:
> > Debian has the beginnings of that.  perl-base is the minimum necessary
> > to have a useful Perl, basically a binary, the perl man page, and a
> > handful of critical modules ...
> 
> Wouldn't it be a good idea to try to define packages like these, so
> that packagers can all make consistent packages?

Come again?


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]>   Kwalitee Is Job One
If God made anything more guerrila than your breast, I hope he kept it for
your father.



Fwd: [jhi@iki.fi: 5.8.0 to-do list]

2001-10-09 Thread Michael G Schwern

Straight from the pumking's mouth:


- Forwarded message from Jarkko Hietaniemi <[EMAIL PROTECTED]> -

From: Jarkko Hietaniemi <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: 5.8.0 to-do list

The bad news is that it seems that the things on what I consider to
be a todo list are relatively hard.  The good news is that the list
is not too long.

(1) PerlIO and Threading and Multiplicity

These issues are in deadly embrace.

- Threadunsafety: for example duping (PerlIO_fdupopen), and _perlio
- Memory leakage: _perlio, PerlIO_known_layers, PerlIO_def_layerlist
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2001-08/msg00290.html
- What to do with files at interpreter exit?  close/flush?
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2001-07/msg01296.html
- Multibyte characters get split at buffer limits
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2001-07/msg00974.html
- fileno and duping problems with scalar-based filehandles
http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2001-10/msg00314.html
   
Arthur needs to integrate threads::shared :-)

Someone needs to update perlthrtut for the new threads module.
Dan and Jon have given their respective permissions to slice
and dice the perlothrtut material as appropriate.  Related to
this, Dan would like to see the Thread.pm becoming a smart
wrapper that would Do The Right Thing depending on the underlying
thread implementation, be it ithreads or the 5.005 threads.

(2) MakeMaker's PASTHRU of INC (among other things)

Previously MM didn't pass through INC, DEFINE, etc., to recursive makes.
Now it does as Alan (and others) supplied enough reasons for doing so.
The problem is that this breaks Tk and NI-S is unhappy.
Makemaker hacking needed to find a solution that keeps all happy.

(3) Attributes are somewhat broken as Arthur demonstrated.

http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2001-10/msg00051.html

Damian, Arthur, and Abhijit are on this.
Spider, who architected the attribute implementation,
seems unfortunately have fallen off the map.

(4) Unicode

Even though Perl 5.8.0 will have a reasonably robust Unicode
support it still does not even meet the "Level 1 - Basic Unicode
Support" as defined by the Unicode standard, TR #18, "Unicode
Regular Expression Guidelines", available online at
http://www.unicode.org/unicode/reports/tr18/

What we are missing (as per my reading, I would appreciate
other people trawling the TR #18, too):

2.3 Subtraction - MISSING   [5][6]
2.5 Simple Loose Matches- MISSING   [8]
2.6 End of Line - MISSING   [9][10]

[ 5] have negation
[ 6] can use look-ahead to emulate subtracion
[ 8] see UTR#21 Case Mappings
[ 9] see UTR#13 Unicode Newline Guidelines
[10] should do ^ and $ also on \x{2028} and \x{2029}

The above list comes from any recent perlunicode.pod.  "Subtraction"
refers to character class subtraction.  "Simple Loose Matches" refers
to the fine points of upper/lower/titlecasing, and here especially
as regards to matching-- currently we do handle the basic casing
as specified by the UnicodeData (lib/unicore/Unicode.txt), but not
the fine print of SpecialCasing (lib/unicore/SpecCase.txt).  "End
of Line" refers to few additional characters than just \n and \r
that should be meaningful in deciding what consitute a line.

Jeff & Jeff (Friedl and Pinyan) were working on the character class
arithmetics but were overcome by the Unicode part of it.  IIRC Larry's
opinion on the syntax was to use [[foo]&&[^bar]] for subtraction, and
[[foo]&&[bar]] for intersection, not the syntax proposed in the TR #18.

I think I have measurably better chance than a snowball in hell
in fixing the casing dilemma.

The end of line issue should be a walk in the park for someone
who knows their way around the parser, right?

As a pure maintenance task I want to rewrite lib/unicore/mktables.PL
(the script that generates the lib/unicore/**/*.pl), the mktables
has grown to be a horrible fetid mess, mostly thanks to the undersigned.
As a part of this de-Stygianery I will also allow spelling out
the character properties (like \p{IsLu}) in full
(like \p{UppercaseLetter}).

(5) The whole FAQ needs to be updated section by section
to check that there is no obsolete material.  Updating
is the primary goal; please abstain from "style updates"
of code since that seems to be a contentious issue; we have
better things to spend our time on than to bicker about indentation.

(6) No new modules for 5.8.0

EXCEPT threads::shared (sidekick of threads) and *possibly*
something from Damian related to the attribute handlers.

I have Plans for 5.8.1, though, of including

[ANNOUNCE] Test::Simple/More/Builder 0.31

2001-10-09 Thread Michael G Schwern

http://www.pobox.com/~schwern/src/Test-Simple-0.31.tar.gz

Three major new things in this version.  I think this should make
everyone happy.

* Test::More::is_deeply() 

A deep comparison version of is() with sensible
diagnostics:

use Test::More tests => 1;

$foo = { foo => [1..9] };  $bar = { foo => [1..10] };
is_deeply($foo, $bar);

1..1
not ok 1
# Failed test (- at line 4)
# Structures begin differing at:
#  $got->{foo}[9] = Does not exist
# $expected->{foo}[9] = '10'

properly displaying structures involving scalar references still needs
some work.  Look at the test commented out in t/is_deeply.t for
details.

I need to gut this functionality out of Test::More and into
Test::Builder so others can use it.

* use Test::More tests => 42, import => [!fail];

Control of what functions Test::More exports.

* Test::Builder->no_header and Test::Builder->no_ending

Control of if the "1..42" line is displayed and if the end of tests
diagnostics are done (ie. the "# looks like you failed...").


0.31  Mon Oct  8 19:24:53 EDT 2001
* Added an import option to Test::More
* Added no_ending and no_header options to Test::Builder
  (Thanks to Dave Rolsky for giving this a swift kick in the ass)
* Added is_deeply().  Display of scalar refs not quite 100%
  (Thanks to Stas Bekman and Apache::TestUtil idea thievery)
- Fixed a minor warning with skip()
  (Thanks to Wolfgang Weisselberg for finding this one)

0.30  Thu Sep 27 22:10:04 EDT 2001
* Added Test::Builder
* Diagnostics are back to using STDERR *unless* it's from a todo
  test.  Those go to STDOUT.
- Fixed it so nothing is printed if a test is run with a -c flag.
  Handy when a test is being deparsed with B::Deparse.


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]>   Kwalitee Is Job One
Lesbian lovers
return to fourth grade slogans
EAT SOME PASTE, they cry

sobbing lesbian
excluded from the party
allergic to wheat
-- mjd



[PATCH Test::Tutorial] Don't Assume Tests Pass in Test Names

2001-10-09 Thread chromatic

Our fearless pumpking recently weighed in on test names that assume success.
What he said made a lot of sense.  If a test fails, the message looks all
wrong.

That may compel some people to fix the tests or the modules, but it may confuse
more people.

Here's a patch to Test::Tutorial that improves the test names along those
criteria.  It may be worth adding a few lines on good test names.

Maybe it's worth discussing good testing style, too.

-- c

--- lib/Test/~Tutorial.pod  Tue Oct  9 21:00:06 2001
+++ lib/Test/Tutorial.pod   Tue Oct  9 21:18:18 2001
@@ -124,14 +124,14 @@
 
 use Test::Simple tests => 2;
 
-ok( defined $ical,  'new() returned something' );
-ok( $ical->isa('Date::ICal'),   "  and it's the right class" );
+ok( defined $ical, 'new() should return something' );
+ok( $ical->isa('Date::ICal'),  '  and it should be Date::ICal or a child' );
 
 So now you'd see...
 
 1..2
-ok 1 - new() returned something
-ok 2 -   and it's the right class
+ok 1 - new() should return something
+ok 2 -   and it should be Date::ICal or a child
 
 
 =head2 Test the manual
@@ -150,8 +150,8 @@
  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( defined $ical,'new() should return something' );
+ok( $ical->isa('Date::ICal'), '  and it should be Date::ICal or a child' );
 ok( $ical->sec   == 47,   '  sec()'   );
 ok( $ical->min   == 12,   '  min()'   );
 ok( $ical->hour  == 16,   '  hour()'  );
@@ -162,8 +162,8 @@
 run that and you get:
 
 1..8
-ok 1 - new() returned something
-ok 2 -   and it's the right class
+ok 1 - new() should return something
+ok 2 -   and it should be Date::ICal or a child
 ok 3 -   sec()
 ok 4 -   min()
 ok 5 -   hour()
@@ -198,8 +198,8 @@
  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( defined $ical,'new() should return something' );
+ok( $ical->isa('Date::ICal'), '  and it should be Date::ICal or a child' );
 is( $ical->sec, 47,   '  sec()'   );
 is( $ical->min, 12,   '  min()'   );
 is( $ical->hour,16,   '  hour()'  );
@@ -211,8 +211,8 @@
 you get some more information
 
 1..8
-ok 1 - new() returned something
-ok 2 -   and it's the right class
+ok 1 - new() should return something
+ok 2 -   and it should be Date::ICal or a child
 ok 3 -   sec()
 ok 4 -   min()
 ok 5 -   hour()
@@ -280,7 +280,7 @@
 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" );
+ok( $ical->isa('Date::ICal'), "  and it should be the right class" );
 
 is( $ical->year,$expect->[0], '  year()'  );
 is( $ical->month,   $expect->[1], '  month()' );
@@ -314,7 +314,7 @@
 itself we're trying out to the name.  So you get results like:
 
 ok 25 - new(ical => '19971024T12')
-ok 26 -   and it's the right class
+ok 26 -   and it should be the right class
 ok 27 -   year()
 ok 28 -   month()
 ok 29 -   day()



Re: [PATCH Test::Tutorial] Don't Assume Tests Pass in Test Names

2001-10-09 Thread Michael G Schwern

On Tue, Oct 09, 2001 at 09:25:08PM -0600, chromatic wrote:
> Here's a patch to Test::Tutorial that improves the test names along those
> criteria.  It may be worth adding a few lines on good test names.
> 
> Maybe it's worth discussing good testing style, too.

Maybe it's worth editing on the Wiki. :)

http://www.pobox.com/~schwern/cgi-bin/perl-qa-wiki.cgi?TestTutorial


PS I've been neglecting to sync up the CPAN Test::Tutorial with the
Wiki version.  Now that Test::Builder is off the ground I can try to
get the turorial and FAQ together.

-- 

Michael G. Schwern   <[EMAIL PROTECTED]>http://www.pobox.com/~schwern/
Perl6 Quality Assurance <[EMAIL PROTECTED]>   Kwalitee Is Job One
"You killed my fish?"
"Why does that pickle you?"
http://sluggy.com/d/010204.html



Re: Test::Harness in Test-SDK conflicts with Perl

2001-10-09 Thread Kirrily Robert

In perl.qa, you wrote:
>On Tue, Oct 09, 2001 at 10:10:33PM +0200, Johan Vromans wrote:
>> Michael G Schwern <[EMAIL PROTECTED]> writes:
>> > Debian has the beginnings of that.  perl-base is the minimum necessary
>> > to have a useful Perl, basically a binary, the perl man page, and a
>> > handful of critical modules ...
>> 
>> Wouldn't it be a good idea to try to define packages like these, so
>> that packagers can all make consistent packages?
>
>Come again?

I think he's trying to say that Perl (i.e. the "Perl community") should
define these things so that different packagers (Debian, Red Hat,
whoever) can have somewhat-consistent packages.

K.

-- 
Kirrily 'Skud' Robert - [EMAIL PROTECTED] - http://infotrope.net/
If it's not broken, break it.