Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tests for native attribute BUILDPLAN.
  • Loading branch information
timo committed Oct 28, 2013
1 parent cc153df commit 9b8425a
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion S12-construction/construction.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 15;
plan 18;

# L<S12/"Construction and Initialization">

Expand Down Expand Up @@ -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.