Permalink
Browse files

[spec]

 * fudged try.t
 * corrected POD
 * switched from try to eval for a test which produced a compile time error


git-svn-id: http://svn.pugscode.org/pugs@20617 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent e9a2e57 commit 02c58e21a43fd02a0016211772f51bfc4b57cf2c moritz committed Jun 1, 2008
Showing with 22 additions and 13 deletions.
  1. +2 −2 S02-magicals/block.t
  2. +3 −3 S02-magicals/dollar_bang.t
  3. +2 −2 S02-magicals/env.t
  4. +15 −6 S04-statements/try.t
View
@@ -2,13 +2,13 @@ use v6;
use Test;
-=pod
+=begin description
This tests the &?BLOCK magical from Synoposis 6
L<S06/The C<&?BLOCK> object>
-=cut
+=end description
plan 1;
@@ -4,15 +4,15 @@ use Test;
plan 8;
-=head1 DESCRIPTION
+=begin desc
This test tests the C<$!> builtin.
-=cut
+=end desc
# L<S04/"Exceptions"/"A bare die/fail takes $! as the default argument.">
-try { &nonexisting_subroutine() };
+eval '&nonexisting_subroutine()';
ok $!, 'Calling a nonexisting subroutine sets $!';
undefine $!;
View
@@ -11,7 +11,7 @@ if $*OS eq "browser" {
exit;
}
-=kwid
+=begin desc
= DESCRIPTION
@@ -20,7 +20,7 @@ Tests for %*ENV
Tests that C<%*ENV> can be read and written to and that
child processes see the modified C<%*ENV>.
-=cut
+=end desc
# It must not be empty at startup.
ok +%*ENV.keys, '%*ENV has keys';
View
@@ -51,6 +51,7 @@ plan 25;
}
#?pugs todo
+#?rakudo skip "parse error"
{
# try with a catch
my $caught;
@@ -69,8 +70,10 @@ plan 25;
# return value 42. But when the end of the test is reached, &try will
# **resume after the return**, effectively running the tests twice.
# (Therefore I moved the tests to the end, so not all tests are rerun).
+
+#?rakudo skip "return() not implemented"
{
- my $was_in_foo;
+ my $was_in_foo = 0;
sub foo {
$was_in_foo++;
try { return 42 };
@@ -82,12 +85,12 @@ plan 25;
}
{
- my sub test1 {
+ sub test1 {
try { return 42 };
return 23;
}
- my sub test2 {
+ sub test2 {
test1();
die 42;
}
@@ -96,10 +99,12 @@ plan 25;
"return() inside a try{}-block should cause following exceptions to really die";
}
-unless (eval 'Exception.new') {
- skip_rest "No Exception objects"; exit
-}
+#unless eval 'Exception.new' {
+# skip_rest "No Exception objects"; exit;
+#}
+#?rakudo skip "parse error"
+#?rakduo DOES 2
{
# exception classes
class Naughty is Exception {};
@@ -122,6 +127,8 @@ unless (eval 'Exception.new') {
ok($caught, "caught exception of class Naughty");
};
+#?rakudo skip "parse error"
+#?rakduo DOES 2
{
# exception superclass
class Naughty::Specific is Naughty {};
@@ -146,6 +153,8 @@ unless (eval 'Exception.new') {
ok($naughty, "caught superclass");
};
+#?rakudo skip "parse error"
+#?rakduo DOES 3
{
# uncaught class
eval 'class Dandy is Exception {}';

0 comments on commit 02c58e2

Please sign in to comment.