This is an automatically generated mail to inform you that tests are now
available in t/spec/S04-declarations/constant.t
commit bb301917e805250f795bccf238ad292f33376700
Author: moritz <mor...@c213334d-75ef-0310-aa23-eaa082d1ae64>
Date: Tue Oct 13 12:20:46 2009 +0000
[t/spec] Test for RT #69740
git-svn-id: http://svn.pugscode.org/p...@28779
c213334d-75ef-0310-aa23-eaa082d1ae64
diff --git a/t/spec/S04-declarations/constant.t
b/t/spec/S04-declarations/constant.t
index fade05c..b207465 100644
--- a/t/spec/S04-declarations/constant.t
+++ b/t/spec/S04-declarations/constant.t
@@ -2,30 +2,37 @@ use v6;
use Test;
-plan 33;
+plan *;
# L<S04/The Relationship of Blocks and Declarations/"The new constant
declarator">
# Following tests test whether the declaration succeeded.
#?pugs todo 'feature'
{
- my $ok;
-
constant foo = 42;
- $ok = foo == 42;
- ok $ok, "declaring a sigilless constant using 'constant' works";
+ ok foo == 42, "declaring a sigilless constant using 'constant' works";
+ dies_ok { foo = 3 }, "can't reasign to a sigil-less constant";
}
{
my $ok;
constant $bar = 42;
- $ok = $bar == 42;
+ ok $bar == 42, "declaring a constant with a sigil using 'constant' works";
+ dies_ok { $bar = 2 }, "Can't reasign to a sigiled constant";
+}
- ok $ok, "declaring a constant with a sigil using 'constant' works";
+#?rakudo skip 'RT 69740'
+{
+ constant ($a, $b) = (3, 4);
+ is $a, 3, 'multiple constant in one declaration(1)';
+ is $b, 4, 'multiple constant in one declaration(2)';
+ dies_ok { $a = 4 }, 'and they are really constant (1)';
+ dies_ok { $b = 4 }, 'and they are really constant (2)';
}
+
{
{
constant foo2 = 42;
@@ -239,4 +246,6 @@ plan 33;
'assign constant its own value from expression';
}
+done_testing;
+
# vim: ft=perl6