Skip to content
Browse files

[t/spec] Some more tests to exercise <->.

git-svn-id: http://svn.pugscode.org/pugs@25294 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent c401696 commit 3b8f4d2dde2958d8f7a4dbd498ee39662450e6f3 jnthn committed Feb 11, 2009
Showing with 13 additions and 1 deletion.
  1. +13 −1 S06-traits/misc.t
View
14 S06-traits/misc.t
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 14;
+plan 17;
=begin description
@@ -70,6 +70,18 @@ lives_ok { boom(42) }, "can modify a copy";
is($foo, 2, 'is ref works', :todo);
}
+
+# with <-> we should still obey readonly traits
+{
+ my $anon1 = <-> $a is readonly, $b { $b++ };
+ my $anon2 = <-> $a is readonly, $b { $a++ };
+ my $x = 1;
+ $anon1($x, $x);
+ is($x, 2, '<-> does not override explicit traints (sanity)');
+ dies_ok({ $anon2($x, $x) }, '<-> does not override explicit traints');
+ is($x, 2, '<-> does not override explicit traints (sanity)');
+}
+
# is context
# Doesn't even compile, which is lucky, because I don't understand it well
# enough to write an actual test...

0 comments on commit 3b8f4d2

Please sign in to comment.
Something went wrong with that request. Please try again.