Re: Time for a Revolution

2006-07-14 Thread Andrew Savige
--- Nicholas Clark wrote: > On Sat, Jul 15, 2006 at 08:36:54AM +1000, Andrew Savige wrote: > > Who's Chromatic? > > And it wasn't even the start of a sentence. :-) > > [When doing the perl 6 summaries, Piers reconciled the forces of accuracy and > traditi

Re: Time for a Revolution

2006-07-14 Thread Andrew Savige
--- Clayton O'Neill wrote: > I think a core difference between your list and Chromatic's is that > yours would be part of the standard library in a lot of languages, > whereas Chromatic seems to be aiming more for things that would be > part of the language. Who's Chromatic? /-\

Re: Continuous testing tools

2006-06-09 Thread Andrew Savige
--- Adam Kennedy wrote: > I know it's somewhat vapour at the moment, and I'm keeping somewhat > quiet, but the new post-Audrey'fied PITA design is aiming at exactly > what you have described. Thanks for the reminder about PITA. I'd (unforgivably) forgotten about that project when I first enquire

Continuous testing tools

2006-06-07 Thread Andrew Savige
We are looking at introducing continuous builds/smoke tests at work across a number of platforms (mainly Windows and Unix), building a number of different languages (mainly C++). I quick google uncovered the list below. Anyone got any advice? Thanks, /-\ Perl * AutoBuild: http://www.auto

RE: Is there an "integrated" test suite/module to test all standard modules of Perl itself?

2006-04-30 Thread Andrew Savige
--- "Fu, Elva" wrote: > It seems there are really an ¡°Integrated¡± test suites existed to test Perl > itself. Who could give me a hand to find it? Thanks in advance. I thought chromatic already this question by pointing you at the t/ directories in the Perl source code distribution. To clarify,

Re: [OT] TDD only works for simple things...

2006-03-29 Thread Andrew Savige
--- Tels wrote: > although I still can only guess what TDD stands for :) Tolkien Driven Development? Googling around for examples of real world large systems developed using TDD, I found http://www.agiledata.org/essays/tdd.html which states: The first reaction that many people have to agile tec

Re: New kwalitee metric - eg/ directory

2006-03-14 Thread Andrew Savige
--- Tyler MacDonald wrote: > Well so far the only ones I've seen are "eg", "examples", and from that > renegade GD::Graph, "samples". And from that eccentric Acme::Bleach, "demo". /-\ On yahoo!7 Avatars: Dress up like yo

Re: Is S05 correct?

2006-02-05 Thread Andrew Savige
--- Larry Wall wrote: > Yes, that's a typo. Which reminds me, I noticed some Synopsis typos as follows. S03: 1) "List flattening" section, sixth paragraph: ... call semantics as is does in scalar context Change "is" to "it". S04: 1) "The do-once loop" section, last paragraph: ... follow

Re: How to best have statements execute only during dev/testing?

2006-01-11 Thread Andrew Savige
--- "A. Pagaltzis" wrote: > Additive filters that the same code can run without are > sane when used carefully, and they're easy to create if the > trigger is a special comment or better yet POD section: Damian's Smart::Comments module filters specially formatted comments and can do assertions and

Building the documentation that will ship with Perl 6 and Pugs

2005-12-30 Thread Andrew Savige
[Note: Posted to both perl6-language and perl6-documentation. Since perl6-documentation is no longer advertised, I assume follow ups should be posted to perl6-language only]. When Audrey gave a recent talk to Sydney.pm, she pointed out some deficiencies in the current Pugs/Perl 6 documentation and

for loop list of lists: flattening arguments to pointy sub

2005-12-25 Thread Andrew Savige
Flattening argument lists is not yet working in Pugs, so I can't easily play around with this one, hence this question. In Pugs, you can process a simple list of lists like this: my @lol = ( [ '1a', '1b' ], [ '2a', '2b' ], [ '3a', '3b' ] ); for @lol -> $t { say "1st='$t[0]' 2nd='$t[1]'" } Yet th

Multiple implementations of Perl 6

2005-12-24 Thread Andrew Savige
Apologies if I'm Mr Magoo, but I did a bit of a search on this just now, and uncovered little more than a pithy quote from Piers Cawley in: http://dev.perl.org/perl6/list-summaries/2005/p6summary.2005-07-05.html asserting that "Multiple implementations are good, m'kay". If anyone can point me to

[Pugs] Change in behaviour of reversing lines in a file (golf example)

2005-11-06 Thread Andrew Savige
On revisiting the old p6 golf example programs of *cough* six months ago, I noticed they all still worked save one: [=<>].reverse.print This used to reverse the lines in a file, but now prints the lines unreversed and with a space in between each line. It seems the original behaviour can be rest

Re: txt vs OO [was: "Re: Proposal to make class method non-inheritable"]

2005-10-26 Thread Andrew Savige
--- Larry Wall wrote: > On Tue, Oct 25, 2005 at 05:24:52PM +0200, Michele Dondi wrote: > : But maybe that's just me. Whatever, I guess that the {casual,average} > : programmer may be scared by its richness and complexity. > > But we're trying to design the OO features (indeed, all of Perl 6) > su

Re: CPANTS new

2005-09-18 Thread Andrew Savige
--- David Landgren wrote: > Seriously though, I have a module whose test suite includes Test::Pod > and Test::Pod::Coverage, except that I use the following construct: > > SKIP: { > skip( 'Test::Pod not installed on this system', 1 ) > unless do { > eval qq{ use Test::P

Re: Why are we adding more kwalitee tests?

2005-09-06 Thread Andrew Savige
--- Thomas Klausner wrote: > *) CPANTS is not describing the one and only way how to write Perl / pack > distribution. It's more of an online mutliplayer game where people submit > their dists which than fight against my evil metrics. The multiplayer game you describe is subject to the testing phe

Re: Why are we adding more kwalitee tests?

2005-09-06 Thread Andrew Savige
--- Andy Lester wrote: > But will the author actually care? Will the author even know this > exists? Are you going to send email to Bob and say "Hey, Bob, you only > passed 7 of 23 things"? What's Bob going to say in return? I see a > couple of options: Ah, now I see where you are coming from.

Re: Why are we adding more kwalitee tests?

2005-09-06 Thread Andrew Savige
--- Andy Lester <[EMAIL PROTECTED]> wrote: > Why are we worrying about these automated kwalitee tests? What will > happen once we find that DBIx::Wango has only passed 7 of these 23 > items on the checklist? I am not the one to answer this, but I'm curious to know where you are coming from. Is

Re: Adding more kwalitee tests

2005-09-05 Thread Andrew Savige
--- Thomas Klausner wrote: > --- Adam Kennedy wrote: >> has_perl_dependency: >> >> In the META.yml (assuming it exists) there is a dependency on the >> version of perl required to install the dist. >> >> The goal of this is to make life a little easier on installers and CPAN >> testers and a fe

[pugs] @x[1 .. Inf] ok yet @x[1..Inf] fails

2005-05-22 Thread Andrew Savige
While the expression: @x[1 .. Inf]; is happily accepted by Pugs, this one: @x[1..Inf]; fails with the message: *** Error: No compatible subroutine found: "&.Inf" I noticed this when revisiting the original Pugs golf examples. If I was just playing golf, I would use: @x[1...]; wh

Overriding/redefining p6 built-in functions

2005-05-07 Thread Andrew Savige
A crude hack sometimes used by gung ho p5 testers is to redefine perl built-in functions. For example: BEGIN { *CORE::GLOBAL::read = sub (*\$$;$) { return undef }; } to test read failures (and so boost your Devel::Cover score :-). This technique is not very convenient (must be in a BEGIN bloc

Re: Pugs 6.2.0 released.

2005-04-12 Thread Andrew Savige
--- Matt Fowles <[EMAIL PROTECTED]> wrote: > Autrijus~ > > On Apr 12, 2005 3:50 PM, Autrijus Tang <[EMAIL PROTECTED]> wrote: > > * `xor` and `^^` now short-circuits > > How does this work? I thought xor /had/ to evaluate both sides. It does. At least according to "Perl 6 and Parrot Essentials"

Re: [pugs] several questions

2005-04-10 Thread Andrew Savige
--- BÁRTHÁZI András <[EMAIL PROTECTED]> wrote: > It seems to me, that Pugs is in strict mode, and I can't say "$a = 5", I > have to say "my $a = 5". It is the right behaviour, or it is the deafult > behaviour and I should change it with a keyword, or it is the current > Pugs implementation and w

[Pugs] Some slice oddities

2005-04-09 Thread Andrew Savige
I noticed some changes in Pugs behaviour when trying to update the golf tests (I will update them in svn within 24 hours, I hope). I'm not certain they are bugs, hence this email. This looks like a bug to me (it used to work): # cat head5.p6 my @x = ( 'a1', 'a2', 'a3' ); say(@x[0..2]); # pugs he

[Pugs] Simple list of lists: Pugs confounded me

2005-04-08 Thread Andrew Savige
I'd like to convert the following p5 code to p6: my @z = ( [ 'a1', 'a2' ], [ 'b1', 'b2', 'b3' ] ); for my $r (@z) { print "@$r\n" } I thought this might do the trick [1]: my @z = ( [ 'a1', 'a2' ], [ 'b1', 'b2', 'b3' ] ); for @z -> $r { say $r } However, the p5 version prints: a

Re: Pugs Lazy Bug

2005-04-04 Thread Andrew Savige
--- Stevan Little wrote: > Howdy all, > > While writing some new Pugs examples I came across another file reading > bug having to do with laziness. When a list is slurped from a > filehandle, then the file closed before the list is accessed, the list > seems to be empty. I believe this is beca

Re: Testing Net-SSLeay

2005-04-02 Thread Andrew Savige
--- Andy Lester wrote: > I'd throw my hands up and let it go, then. One of the key functions of > Phalanx is to modernize the testing infrastructure of the modules we > touch. If he needs it to stay compatible back to the relative dark > ages, then let's just leave it that way. Though many modul

Re: Pugs Bug

2005-04-02 Thread Andrew Savige
--- Stevan Little wrote: > I was writing tests for split(, ) and I stumbled upon this > bug: > > pugs -e 'split(rx:perl5//, "not good")' > > Will go into an infinite loop. I also tried the empty regexp in a match > on it's own, and it was not a problem. Further to that, I noticed that the somewh

Definitive and Complete Perl 6 Operator List

2005-04-01 Thread Andrew Savige
S03 does not seem to detail a complete list of all Perl 6 operators. For example, it explicitly mentions += but does not mention -= Googling around, I found the Perl 6 Periodic Table of Operators http://www.ozonehouse.com/mark/blog/code/PeriodicTable.html (which I assume does not form part of the

Re: [Pugs] A couple of string interpolation edge cases

2005-03-26 Thread Andrew Savige
--- Luke Palmer wrote: > Andrew Savige writes: > > I stumbled across a couple of interesting quote interpolation > > edge cases: Just toppled over the edge of another two sand traps. Case 3 -- # cat q7.p6 my $x = '\\x'; print "x='$x'\n"; # perl

[Pugs] Semicolon as statement terminator

2005-03-25 Thread Andrew Savige
I was flabbergasted by this one. # cat weird.p6 my$x=42my$y="Zaphod"~"Beeblebrox"my$z="I think they're just strange symbols of some kind"say"x='$x' y='$y' z='$z'" # pugs weird.p6 x='42' y='ZaphodBeeblebrox' z='I think they're just strange symbols of some kind' Wow! It actually seems to work. Are

[Pugs] A couple of string interpolation edge cases

2005-03-25 Thread Andrew Savige
I stumbled across a couple of interesting quote interpolation edge cases: Case 1 -- # cat ttt.p6 my $x = "{"; # pugs ttt.p6 unexpected end of input expecting "\"", "$!", "$/", "\\" or block NonTerm SourcePos "ttt.p6" 2 1 Is this a bug? Case 2 -- # cat q1.pl my $x = "$"; print "x='$x'

Moving the p5 standard library to p6

2005-03-25 Thread Andrew Savige
I noticed the Pugs folks have started porting File::Spec and other modules to Pugs, which leads me to ask this question. I've also taken a look at Rod Adams S29. There a quite a few p5 standard libraries with crusty old user interfaces that many folks dislike. Two that people often seem to complai

[Pugs] More Pugs precedence idiosyncrasies

2005-03-25 Thread Andrew Savige
Just a couple more p5/pugs anomalies I noticed. # This does not work in pugs: "No compatible subroutine found: &my". my $x = my $y = 0; I noticed the next one when using the new slurp() function. Looks like an operator precedence problem. # cat f.p6 sub ret_list_0 { () } sub ret_list_3 { ( 'abc'

Re: [Pugs] Writing tests that run pugs ($^X or equivalent would seem handy)

2005-03-24 Thread Andrew Savige
--- Larry Wall <[EMAIL PROTECTED]> wrote: > On Thu, Mar 24, 2005 at 01:17:40PM +0800, Autrijus Tang wrote: > : As of r1079, there is $?EXECUTABLE_NAME (that is, $^X in perl5) and > : $?PROGRAM_NAME (that is, $0 in perl5). Note that those two things > : are unspecced -- I just pulled them out from

[Pugs] Writing tests that run pugs ($^X or equivalent would seem handy)

2005-03-22 Thread Andrew Savige
Unless I hear any objections, I plan to add: t/examples/golf.t to automate running of tsanta.p6, so as to verify both my original and rg0now's Santa golf solutions. I notice there is an existing (unfinished?) t/examples/examples.t. I could add my new tests there, it's just that I personally prefe

Re: [Pugs] 6.0.12 make test blew up on Windows with "command line too long"

2005-03-21 Thread Andrew Savige
t since I assume autrijus and Ingy will be listening there (and not on perl-qa) and cc'ed Schwern. Schwern wrote: > On Tue, Mar 22, 2005 at 09:24:24AM +1100, Andrew Savige wrote: > > http://www.nntp.perl.org/group/perl.perl6.compiler/413 > > > > 'nmake test' on t

How to fix "command line too long" with "make test" (when you have vast numbers of tests)

2005-03-21 Thread Andrew Savige
As described here: http://www.nntp.perl.org/group/perl.perl6.compiler/413 'nmake test' on the latest release of Pugs blew up under Windows with "command line too long" (using ActiveState perl-5.8.6). Is there a "standard" way to fix this? What do other distributions with vast numbers of tests do

[Pugs] 6.0.12 make test blew up on Windows with "command line too long"

2005-03-21 Thread Andrew Savige
I like the t/ directory reorganisation for 6.0.12 and I congratulate Stevan for the nice README file also. I hope to soon start adding some tests into this new structure. Unfortunately, a disagreeable side effect of this reorganisation is that Pugs 6.0.12 'nmake test' blows up with "command line t

[Pugs] Bitten by Pugs chomp

2005-03-20 Thread Andrew Savige
I'm unsure how chomp() should work with p6; it's not listed in S29 yet. Should the semantics of g.p6 below be the same for p5 and p6? It produces different output when run with p5 compared to pugs, at least that's my sleepy brain sees. # cat g.p6 my @x = ( "a\n", "1", "x\n" ); for (@x) { print "1

[Pugs] END blocks not being executed after die

2005-03-19 Thread Andrew Savige
As shown below, END blocks in Pugs are behaving differently to p5; i.e. the Pugs END block is not being executed after die is called. I expect this is known and a TODO but I thought I'd better report it just in case. # cat f.p6 print "one\n"; die "dying"; print "two\n"; END { print "in end block

Re: Best way to slurp a file in Perl 6

2005-03-19 Thread Andrew Savige
--- Autrijus Tang wrote: > On Fri, Mar 18, 2005 at 09:35:59PM +1100, Andrew Savige wrote: > > What is the best way in Perl6/Pugs to slurp a file? > > You use the slurp() primitive, implemented as r875. :) Thanks. I tested these two forms and it's truly lovely: my $x = s

[Pugs] Parsing bug with trailing comma in array

2005-03-18 Thread Andrew Savige
I noticed this a while ago but forgot to report it. While Pugs is happy with: my @tt = ( 'x', 'y' ); it fails on: my @tt = ( 'x', 'y', ); with the following error message: unexpected ")" expecting term NonTerm SourcePos "a.p6" 4 1 I assume a trailing comma in such cases shoul

Re: [Pugs] Stumbled into another Pugs sand trap (indirect object call I think)

2005-03-18 Thread Andrew Savige
--- Autrijus Tang <[EMAIL PROTECTED]> wrote: > Woot! I'd like to see that program once you finished it. :) I've written up my experiences at: http://www.perlmonks.org/?node_id=440685 I'll commit it to examples/golf after feedback is received. Thanks for all your help! /-\ Find local movie tim

Best way to slurp a file in Perl 6

2005-03-18 Thread Andrew Savige
>From S04: It is possible to write while =$*IN -> $line {...} But it won't do what you expect, because unary = does a slurp in scalar context, so $line will contain the entire file. So I expected this function to slurp the whol

[Pugs] Stumbled into another Pugs sand trap (indirect object call I think)

2005-03-17 Thread Andrew Savige
# cat h3.p6 my $label = 'abc'; print("$label: is this new indirect object call business?\n"); # perl -w h3.p6 abc: is this new indirect object call business? # pugs h3.p6 Undefined variable $label: Var "$label:" I've lost count of the number of punishing Pugs hazards that have snared me in my qu

Re: Testing .pl executables

2005-03-16 Thread Andrew Savige
--- Anuradha Dissanayake <[EMAIL PROTECTED]> wrote: > I'm new to unit testing in Perl, so this may be a stupid question. > > Using Test::More to test .pm perl modules is quite simple as you just > "use" the module in your test executable and call the module's > subroutines inside your tests. > >

[Pugs] Some experiments with the for loop

2005-03-15 Thread Andrew Savige
This little program worked as I expected: my @x = ( "abc\n", "defg\n" ); for @x -> $k { print($k); # length() and bytes() seem not implemented yet (?) ... # so try to get length via split my $len = +split("", $k); say("len=$len"); } So far so good. Now try this instead: m

Re: [Pugs] short-circuit operators

2005-03-15 Thread Andrew Savige
Ferreting around in the #perl6 logs I noticed an acknowledgement that short-circuiting is "borken" as at 15 Maart. Oh well, time for the "mad golfer" to dust off his trusty sand iron and hack his way out of this punishing Pugs sand trap. :-) /-\ Find local movie times and trailers on Yahoo! Movi

Re: [Pugs] short-circuit operators

2005-03-15 Thread Andrew Savige
--- Ingo Blechschmidt wrote: > Andrew Savige wrote: >> The following program: >> >> my $x = 1; >> my $y = 2; >> $x == 1 or $y = 42; > ^ typo? No, it's not a typo. I was (perhaps not very clearly) trying to demonstrate that the short-c

[Pugs] short-circuit operators

2005-03-14 Thread Andrew Savige
The following program: my $x = 1; my $y = 2; $x == 1 or $y = 42; print"x='$x' y='$y'\n"; prints x='1' y='2' in perl5, but prints x='1' y='42' in pugs. (I'm having a go at rewriting a small p5 script in p6 and finding out, by trial and error, what seems to work in Pugs and what doesn't). Oh, and

[Pugs] Closing a file handle surprised the heck out of me

2005-03-14 Thread Andrew Savige
Given this Pugs program, t.p6: my $fh = open(@ARGS[0]); my @lines = =$fh; $fh.close(); for @lines { print"$_" } running: pugs t.p6 t.p6 produces no output. Move $fh.close() to after the for loop and all is well. Is this a bug? /-\ Find local movie times and trailers on Yahoo! Movies. http://

[Pugs] New Pugs developer with no svn (subversion) experience

2005-03-12 Thread Andrew Savige
I'm trying to come up to speed with a lot of things, including subversion, which I've not used before (haven't used cvs either). I'm eager not to stuff anything up. Also, this note might help other newbies in future. After installing svn 1.1.3 on Linux, I issued the command: svn checkout http://s

Re: [Pugs] Should the int() function truncate or round?

2005-03-11 Thread Andrew Savige
--- Autrijus Tang wrote: > It is a closed bug. :) Day 43: > > http://use.perl.org/~autrijus/journal/23524 > > "The int primitive now properly truncates, instead of rounds, the operand." > > 6.0.11 will be out in a couple days that includes this fix. Thanks. In case you're interested, I stu

[Pugs] Should the int() function truncate or round?

2005-03-11 Thread Andrew Savige
Running this program with perl 5: my $i = int(1.9); print "i=$i\n"; produces the answer 1 (i.e. it truncates) while running it with Pugs produces the answer 2 (i.e. it rounds). Is this a bug or a feature? If a feature, how does one truncate with Pugs/Perl6? /-\ Find local movie times and trai

Re: Kwalitee mascot

2004-12-28 Thread Andrew Savige
--- Michael G Schwern wrote: > I hereby propose the Koaladile (Kah-wah-lah-dile) for perl-qa mascot! > > http://i.somethingawful.com/inserts/articlepics/photoshop/12-10-04-animals/AirbagSML.jpg > > "Koaladile is for Kwalitee". (Kah-wah-lah-dile is for Kah-wal-i-tee) > > From Something Awful's

Re: [ANNOUNCE] Test::Simple/More/Builder 0.54 (problem with signa ture?)

2004-12-15 Thread Andrew Savige
Steve Hay wrote: > And this program (500,000 small extensions to a string): > > my $a = ''; > my $start = time; > for my $i (1 .. 50) { > print "$i\n" if $i % 1000 == 0; > $a .= '.' x 20; > } > printf "OK (%d seconds)\n", time - $start; > > is even worse: 1 second again on 5.8.6/perl-malloc

RE: C implementation of Test::Harness' TAP protocol

2004-12-08 Thread Andrew Savige
--- "Clayton, Nik" wrote: > Any "Writing thread safe libraries for dummies" texts you could point > me at? I recommend "Programming with POSIX Threads" by David Butenhof. Re the varargs ok() business, I assume you'll be using some sort of config.h with your libtap library. Any plans on using aut

Re: C implementation of Test::Harness' TAP protocol

2004-12-07 Thread Andrew Savige
--- /-\ wrote: > In an attempt to do varargs ok() without the magical __VA_ARGS__, > I've come up with two little example solutions shown below. > Improvements welcome. Sorry, but curiosity got the better of me and I took a look at how the very widely used and portable C++ ACE library does it. Th

Re: C implementation of Test::Harness' TAP protocol

2004-12-07 Thread Andrew Savige
--- muppet wrote: > writing your own printf-style macros is actually a very common idiom > for getting around this sort of technical problem. they, of course, > raise the further problem that GCC's vararg macros are not portable, > and C99's vararg macros are not yet universally supported. Ag

RE: C implementation of Test::Harness' TAP protocol

2004-12-07 Thread Andrew Savige
--- "Clayton, Nik" wrote: > Andrew Savige wrote: > > 2) A uniform mechanism for test programs to handle command line > > arguments would be nice. For example: > > > > int main(int argc, char* argv[]) > > { > > ta

Re: C implementation of Test::Harness' TAP protocol

2004-12-06 Thread Andrew Savige
--- Michael G Schwern <[EMAIL PROTECTED]> wrote: > Yucko. > > Test::More implements cmp_ok() using an eval. Could a macro prove useful > here to do something similar? > > cmp_ok(foo, 'int', '==', bar); Good idea Schwern. These test suites inevitably degenerate into macro crack-pipe smoking ses

Re: C implementation of Test::Harness' TAP protocol

2004-12-06 Thread Andrew Savige
--- "Clayton, Nik" <[EMAIL PROTECTED]> wrote: > Having done the initial work to get most of FreeBSD's regression testing > infrastructure producing Test::Harness TAP compatible output, I've started > putting together a C library that makes it easier to write tests in C. Great! This is something I

Re: C implementation of Test::Harness' TAP protocol

2004-12-06 Thread Andrew Savige
--- Michael G Schwern <[EMAIL PROTECTED]> wrote: > On Mon, Dec 06, 2004 at 02:25:42PM -0800, Andrew Savige wrote: > > --- Michael G Schwern <[EMAIL PROTECTED]> wrote: > > > Why add that extra auto-sprintf complexity? Can't the user do the exact > > >

Re: C implementation of Test::Harness' TAP protocol

2004-12-06 Thread Andrew Savige
--- Michael G Schwern <[EMAIL PROTECTED]> wrote: > Why add that extra auto-sprintf complexity? Can't the user do the exact > same thing with: > > ok(some_func(i), sprintf("some_func(%d)", i)); No. sprintf in C needs a buffer and you don't know how big to make it. > > ok2() is for situatio

Re: Test::Simple 0.51 prerelease

2004-11-25 Thread Andrew Savige
--- Michael G Schwern wrote: > Excuse me for a moment. > > I AM SO SICK OF THREADING BUGS!!! BLARHGAGHAGHAHGAH! I don't even USE > THREADS and I seem to find all the bugs!! ARGH!!! > > *ahem* To try and cheer you up a bit, I'm delighted to report that your new Test-Simple-0.51 passed all tes

Test::Harness/prove: printing the test name when a test fails

2004-08-31 Thread Andrew Savige
I am currently trying to sell Test::More/prove and TDD at work. I received a complaint from a newbie workmate today. He complained that when a test, for example: ok( 0 == 1, "This is my test name" ); fails, Test::Harness (and the prove command) by default do not print the test name ("This is my

Aegis "NO RESULT" versus Test::More skip

2004-08-17 Thread Andrew Savige
Does Test::More have an equivalent concept to Aegis "NO RESULT"? Is Aegis "NO RESULT" equivalent to Test::More skip? /-\ Find local movie times and trailers on Yahoo! Movies. http://au.movies.yahoo.com

Re: C/C++ White-Box Unit Testing and Test::More

2004-06-10 Thread Andrew Savige
Ovid wrote: > For white box testing C code, I just use assert(). assert() is ok, but ok() is better. :-) I will prolly roll my own custom ok() macro, so instead of: assert(x==y); I can write: ok(x==y, "test that x equals y"); Writing a lot of tests, I want to be able to easily label each test.

C/C++ White-Box Unit Testing and Test::More

2004-06-08 Thread Andrew Savige
I am currently using Test::More for my Perl white-box unit tests. I also need to write some C/C++ white-box unit tests and would like to use something similar in spirit to Test::More. Smalltalk's SUnit-style framework has been ported to many languages (JUnit, cppunit, Test::Unit, Test::Class, ...)

Mapping test cases to bug databases

2004-05-23 Thread Andrew Savige
Suppose I fix a bug with a unique bug ID in a bug tracking system. I start by dutifully adding 15 new asserts, say, to an existing unit test program, to duplicate the bug before I fix it. What if I later want some way to map the bug ID back to the these 15 new asserts? Should I somehow assign uniqu

Re: Testing Inline::C

2004-02-11 Thread Andrew Savige
Michael G Schwern <[EMAIL PROTECTED]> wrote: > To catch memory mistakes in C, I'd normally use something like Electric > Fence or other malloc replacement. Basically something that replaces the > memory allocation functions with those that put in magic so that if your > program walks outside its a

Re: Using environment variables to control long running tests (again)

2003-11-18 Thread Andrew Savige
Michael G Schwern wrote: > Disabling tests for subjective reasons (they take "too long", they don't > test critical functionality, etc...) is a slippery slope. For that reason > I'd agree with Curtis and say that everything is always run by default > and users can then elect what to turn off. PER

Re: Using environment variables to control long running tests (again)

2003-11-18 Thread Andrew Savige
Ovid wrote: > --- Kate L Pugh wrote: > > This was discussed on this list back in June. I'm wanting to > > implement it now and am wondering if Andrew's suggestion (below) has > > been taken up by anyone. Is PERL_TEST_LONG what people here > > generally > > expect to be the right environment varia

Re: Refactoring a test program: advice sought

2003-11-14 Thread Andrew Savige
Michael G Schwern wrote: > I use t/lib so the top level t/ directory doesn't get cluttered (and for > compatibility with the Perl core which may be important later for A::T). Yes, I like that. Should I call it: t/lib/Test/Archive/Tar... or: t/lib/Archive/Tar/Test... or something else? I took

Refactoring a test program: advice sought

2003-11-13 Thread Andrew Savige
As part of the phalanx project, I've added quite a few new tests to 02_methods.t in the Archive::Tar test suite. Though I'm jubilant the new tests have uncovered a number of bugs, the test code itself has been getting progressively uglier, ripe for refactoring, in fact. To avoid code duplication b

Re: Phalanx

2003-10-29 Thread Andrew Savige
"Jeays, Mark" wrote: > Hi, > > I'm writing on behalf of Ottawa Perl Mongers. At our last meeting, one of > our members gave us a quick introduction to the Phalanx project and its > goals. A number of the members were interested in the idea and we have been > looking for a group project. How would

Re: Trying to spear a phalanx shield for pod

2003-10-26 Thread Andrew Savige
Michael G Schwern wrote: > On Sun, Oct 26, 2003 at 04:45:48PM +1100, Andrew Savige wrote: >> There is a misprint in this line: >>my $have_testpod = !$@ and $Test::Pod::VERSION >= 0.95; >> It should read: >>my $have_testpod = !$@ && $Test::Pod::VERSIO

Re: Trying to spear a phalanx shield for pod

2003-10-25 Thread Andrew Savige
Michael G Schwern wrote: > Since skip_all will exit immediately you can fold that big "everything > inside the else block" away. > > eval 'use Test::Pod'; > my $have_testpod = !$@ and $Test::Pod::VERSION >= 0.95; > plan skip_all => "Test::Pod v0.95 required for testing POD" > unless $have_tes

Trying to spear a phalanx shield for pod

2003-10-24 Thread Andrew Savige
I'm about to add a POD test program to my phalanx distro. Before I do that, just want to check I'm using the best model. I plan on using the one from WWW::Mechanize (shown below) -- unless someone can suggest a better model. Is it worth trying to agree on a de facto standard name for such a beast:

Re: Taint mode testing and project Phalanx

2003-10-21 Thread Andrew Savige
Michael G Schwern wrote: > On Tue, Oct 21, 2003 at 12:34:44PM -0500, Dave Rolsky wrote: >> Anyway, my taint mode experience has been that random things break in very >> weird ways when using it. > > All the more reason to test with it on. :) Given the differences in behaviour with taint mode, it

Re: No more code coverage

2003-10-21 Thread Andrew Savige
Tim Bunce wrote: > p.s. Could someone suggest a pure-perl module with lots of tests as > a suitable testbed for Devel::Cover? http://search.cpan.org/dist/Acme-EyeDrops has 22 test programs, 769 tests and no dependencies. /-\ http://personals.yahoo.com.au - Yahoo! Personals New people, new poss

Taint mode testing and project Phalanx

2003-10-19 Thread Andrew Savige
I noticed in Test::Tutorial: "Taint mode is a funny thing. It's the globalest of all global features. Once you turn it on it effects all code in your program and 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

Re: Devel::Cover can't find loaded modules

2003-10-03 Thread Andrew Savige
Ovid wrote: > I was running some test code with Devel::Cover and I've had no problem using > it or generating pretty reports that make coworkers "ooh" and "ahh". > Unfortunately, I started running my test suite on a different set of > tests and started getting some strange errors... I have no expe

Re: passing arguments to tests

2003-09-15 Thread Andrew Savige
Ovid wrote: > --shuffle will shuffle the order in which the tests are run to ensure that > you have no accidental dependency on test order. > > --fast sets and environment variable that can be checked in the test scripts. > For example, if you have a couple of tests that double the time of your tes

Re: passing arguments to tests

2003-09-13 Thread Andrew Savige
Ovid wrote: > I've just made it available at > http://users.easystreet.com/ovid/cgi_course/downloads/grind.gz > > It needs more work, including allowing descending into directories (via > File::Find or a similar mechanism) and having pre and post actions. > I haven't figured out the best way to do

Re: passing arguments to tests

2003-09-11 Thread Andrew Savige
Ovid wrote: > I do something like the following to get this effect: > > #!/usr/bin/perl -w > use strict; > use Test::Harness; > use Getopt::Long; > use Pod::Usage; > > GetOptions( > 'help|?'=> sub { pod2usage(-verbose => 2); exit }, > 'verbose!' => \$Test::Harness::verbos

Re: passing arguments to tests

2003-09-07 Thread Andrew Savige
Fergal Daly wrote on 14 July 2003: > is it possible with Test::Harness and MakeMaker to pass arguments to > my test scripts? I think it's not but I just want to check for sure. > The module I'm working on is getting a new "optimised" mode so I'd like > to be able to run all the tests twice, once

Re: Phalanx has started, and I need perl-qa's help

2003-08-22 Thread Andrew Savige
> Net_SSLeay.pm Just noticed that's a kinda odd name for a distribution that contains the modules Net::SSLeay and Net::SSLeay::Handle. I wonder why is it not called Net-SSLeay? /-\ http://search.yahoo.com.au - Yahoo! Search - Looking for more? Try the new Yahoo! Search

Re: Phalanx has started, and I need perl-qa's help

2003-08-22 Thread Andrew Savige
Andy Lester wrote: > The Phalanx project has started its rampup to an official > announcement. Phalanx is going to beef up the tests, coverage and > docs on Perl and 100 heavily-used modules from CPAN. > > The project page is at http://qa.perl.org/phalanx/. Please take a > look, tell me your

Re: Passing arguments to tests

2003-08-20 Thread Andrew Savige
A moron once wrote: > I have a similar problem; I'd like some of my test programs > to generate other test programs on the fly, then run them. > > This seems to work: > > use strict; > use Test::Harness; > my $outf = 'out.tmp'; > print "1..1\n"; > local *SAVOUT; open(SAVOUT, ">&STDOUT"); # save or

Re: passing arguments to tests

2003-08-20 Thread Andrew Savige
Michael G Schwern wrote: > On Wed, Aug 20, 2003 at 07:18:54PM +1000, Andrew Savige wrote: > > I admit to asking my original question as a joke since, as of Perl > 5.6.1, > > Test::Harness was pure functional (Test::Harness::Straps no there). > > However, I am not joking

Re: passing arguments to tests

2003-08-20 Thread Andrew Savige
Michael G Schwern wrote: > On Thu, Jul 24, 2003 at 10:55:57AM +1000, Andrew Savige wrote: >> I'd be interested to see an example of sub-classing Test::Harness. > > See examples/mini_harness.plx in Test::Harness. > > The straps interface is not yet entirely usable. Th

Re: Scrutinizing CPAN distributions (was Testing for valid path names...)

2003-08-18 Thread Andrew Savige
Leon Brocard wrote: > I like the is_impolite / is_naughty ideas, and will roll them into the > next version. If you have a simple metric for a good cross-platform > filename, that'd be good. I'll see what I can come up with. > I'm not sure about how you mean a "good" Changes. For a start, people

Scrutinizing CPAN distributions (was Testing for valid path names...)

2003-08-18 Thread Andrew Savige
Though this started as an innocent question, I think it would be nice to have a module/script to scrutinize a CPAN distribution. 1) Archive nit-picker. Archive::Any's is_impolite/is_naughty is a start. Also test for: "good cross-platform" file names (my original question); "good" Changes, RE

Testing for valid path names in CPAN distributions

2003-08-16 Thread Andrew Savige
Running variants of: tar tzf perl-5.8.0.tar.gz | perl -lne'print if tr|-_./a-zA-Z0-9||c' suggests only [-_./a-zA-Z0-9] are valid characters in a path name. Then I noticed 'perldoc perlport' lists the portable filename characters as defined by ANSI C and various other restrictions. What is the le

Re: Testers & PASS

2003-08-03 Thread Andrew Savige
Leon Brocard wrote: > Leon Brocard sent the following bits through the ether: > > > Secondly, who do I need to convince to add the "make test" results for > > PASSes too? ;-) > > So, does anyone actually have an opinion on this? *Puts up hand*. I agree with you. Seems useful and trivial to impleme

Re: passing arguments to tests

2003-07-25 Thread Andrew Savige
> #!/usr/bin/perl > use strict; > use warnings; > > sub my_fn { print "in sub my_fn, args='@_'\n" } > > # This happily calls my_fn(): the parameters received by my_fn are > # 'sample.t' and 'def'. But why? > > 'sample.t'->main::my_fn('def'); > > # ... yet this fails with: Can't call method "mai

Re: passing arguments to tests

2003-07-24 Thread Andrew Savige
Andrew P's test program does indeed "work" with Perl 5.8.0 on both Unix and Windows with a test name of 'sample.t' in THDriver.pl, yet changing it to './sample.t' results in a failure of: Can't call method "SUPER::runtests" without a package or object reference. But why? The snippet below (tested

Re: black-box test tool

2003-07-23 Thread Andrew Savige
Danny Faught wrote: > I've often talked about the difference between my black-box test > experience and the unit testing context that most of you are working in. > I've come across an interesting example of an open source black-box > tool - QMTest, http://www.codesourcery.com/qm/qmtest. Just cur

  1   2   >