Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

t/pugs/operator/arith.t
Jesse asked about getting t/pugs/operator/arith.t to run
on Rakudo, as written arith.t depends on the ".nextwith"
capability from S06.  For example:

sub tryok ($ok, $todo) {
if ($todo) {
&ok.nextwith($ok,$todo, :todo);
} else {
&ok.nextwith($ok);
}
}

I'm of the opinion that we shouldn't require .nextwith to
be implemented for testing something basic like arithmetics,
so if we keep the above I propose changing &ok.nextwith() to
ok() calls for now.

In general, I think that tests should only need a rather
limited set of functions and Perl 6 features, and something
like .nextwith seems to fall outside of that.  So as far
as we can, I think the test suite ought to stick to things
like:

ok($cond)
ok($cond, $desc)

is($got, $expected)
is($got, $expected, $desc)

isnt($got, $expected)
isnt($got, $expected, $desc)

is_approx($got, $expected)
is_approx($got, $expected, $desc)

Note that in the test suite 'todo' and 'skip' are often
handled by fudge as opposed to being an optional argument
to ok().

In the case of arith.t, I don't quite see the need for
the tryok() definition and tryeq().  It seems that it
would be much cleaner and more consistent for arith.t
to use

is           13 %  4, 1;
is          -13 %  4, 3;
is_approx    13e21 % 4e21 - 1e21, 0;
is_approx   -13e21 % 4e21 - 3e21, 0;

instead of

tryeq  13 %  4, 1;
tryeq -13 %  4, 3;
tryok abs( 13e21 %  4e21 -  1e21) < $limit;
tryok abs(-13e21 %  4e21 -  3e21) < $limit;

and locally defined try* subs.  (There's also the point
that 'try' is a keyword in Perl 6, and 'tryeq' and 'tryok'
don't seem to have anything obvious to do with that 'try'.)

Pm


Report this thread to moderator Post Follow-up to this message
Old Post
Patrick R. Michaud
05-02-08 12:59 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Perl 6 Compiler archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:19 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.