Skip to content
Browse files

tests for native attribute BUILDPLAN.

  • Loading branch information...
1 parent cc153df commit 9b8425a5284dd2a37b01ef0429f1703253a72070 @timo timo committed
Showing with 16 additions and 1 deletion.
  1. +16 −1 S12-construction/construction.t
View
17 S12-construction/construction.t
@@ -2,7 +2,7 @@ use v6;
use Test;
-plan 15;
+plan 18;
# L<S12/"Construction and Initialization">
@@ -88,4 +88,19 @@ is Foo.new("a string").a, 'a string', "our own 'new' was called";
is MonkeyNew.new().x, 'called', 'monkey-typed .new() method is called';
}
+{
+ class NativeInt {
+ has int $.attr;
+ }
+ lives_ok -> { NativeInt.new(:attr(123)) }, ".new with a native int attribute";
+ class NativeNum {
+ has num $.attr;
+ }
+ lives_ok -> { NativeNum.new(:attr(0e0)) }, ".new with a native num attribute";
+ class NativeStr {
+ has str $.attr;
+ }
+ lives_ok -> { NativeStr.new(:attr<foo>) }, ".new with a native str attribute";
+}
+
# vim: ft=perl6

0 comments on commit 9b8425a

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