Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Test compilation of attribute lookup also.
  • Loading branch information
jnthn committed May 12, 2012
1 parent ef0edcb commit 2d2de4e
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion t/qast/qast.t
@@ -1,6 +1,6 @@
use QRegex;

plan(45);
plan(46);

# Following a test infrastructure.
sub compile_qast($qast) {
Expand Down Expand Up @@ -598,3 +598,18 @@ test_qast_result(
-> $r {
ok(nqp::getattr_i($r, E, '$!x') == 99, 'attribute binding works');
});

my $test_obj := nqp::create(E);
nqp::bindattr_i($test_obj, E, '$!x', 199);
is_qast_args(
QAST::Block.new(
QAST::Var.new( :name('foo'), :scope('local'), :decl('param') ),
QAST::Var.new(
:scope('attribute'), :name('$!x'), :returns(int),
QAST::Var.new( :name('foo'), :scope('local') ),
QAST::WVal.new( :value(E) )
)
),
[$test_obj],
199,
'attribute lookup works');

0 comments on commit 2d2de4e

Please sign in to comment.