Skip to content

Commit

Permalink
Mark new failing JVM tests as TODO
Browse files Browse the repository at this point in the history
Pawel introduced some new tests for the JS backend, which is a great
way to kick the tires on the *other* backends, such as the JVM.
Unfortunately, the functionality tested isn't ready yet for
the JVM, so we'll mark it as todo for now.
  • Loading branch information
hoelzro committed May 21, 2016
1 parent ac50b73 commit 61b3f00
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 55 deletions.
85 changes: 45 additions & 40 deletions t/qast/01-qast.t
Original file line number Diff line number Diff line change
Expand Up @@ -1005,50 +1005,55 @@ my $sc := nqp::createsc('exampleHandle');
nqp::scsetobj($sc, 0, $g1);
nqp::setobjsc($g1, $sc);

is_qast(
QAST::Block.new(
QAST::Op.new(
:op<bind>,
QAST::Var.new( :name<$i>, :scope<lexical>, :decl<var>, :returns(int) ),
QAST::IVal.new( :value(3) )
),
QAST::Op.new(
:op<bind>,
QAST::Var.new( :name<$total>, :scope<lexical>, :decl<var>, :returns(int) ),
QAST::IVal.new( :value(0) )
),
QAST::Op.new(
:op<while>,
QAST::Var.new( :name<$i>, :scope<lexical> ),
QAST::Block.new(:blocktype<immediate>,
# QAST::Op.new(:op('say'), QAST::Var.new(:name('$total'), :scope<lexical>)),
QAST::Var.new( :name<$x>, :scope<lexical>, :decl<contvar>, :value($g1) ),
QAST::Op.new(
:op<bind>,
QAST::Var.new( :name<$i>, :scope<lexical> ),
if nqp::getcomp('nqp').backend.name eq 'jvm' {
todo('contvar tests need work on JVM', 1);
ok(0);
} else {
is_qast(
QAST::Block.new(
QAST::Op.new(
:op<bind>,
QAST::Var.new( :name<$i>, :scope<lexical>, :decl<var>, :returns(int) ),
QAST::IVal.new( :value(3) )
),
QAST::Op.new(
:op<bind>,
QAST::Var.new( :name<$total>, :scope<lexical>, :decl<var>, :returns(int) ),
QAST::IVal.new( :value(0) )
),
QAST::Op.new(
:op<while>,
QAST::Var.new( :name<$i>, :scope<lexical> ),
QAST::Block.new(:blocktype<immediate>,
# QAST::Op.new(:op('say'), QAST::Var.new(:name('$total'), :scope<lexical>)),
QAST::Var.new( :name<$x>, :scope<lexical>, :decl<contvar>, :value($g1) ),
QAST::Op.new(
:op<sub_i>,
:op<bind>,
QAST::Var.new( :name<$i>, :scope<lexical> ),
QAST::IVal.new( :value(1) )
)
),
QAST::Op.new(
:op<bind>,
QAST::Var.new( :name<$total>, :scope<lexical>, :returns(int) ),
QAST::Op.new(:op<add_i>,
QAST::Op.new(
:op<callmethod>, :name<plus>,
QAST::Var.new( :name<$x>, :scope<lexical> )
),
QAST::Var.new(:scope<lexical>, :name<$total>)
)
),
)
:op<sub_i>,
QAST::Var.new( :name<$i>, :scope<lexical> ),
QAST::IVal.new( :value(1) )
)
),
QAST::Op.new(
:op<bind>,
QAST::Var.new( :name<$total>, :scope<lexical>, :returns(int) ),
QAST::Op.new(:op<add_i>,
QAST::Op.new(
:op<callmethod>, :name<plus>,
QAST::Var.new( :name<$x>, :scope<lexical> )
),
QAST::Var.new(:scope<lexical>, :name<$total>)
)
),
)
),
QAST::Var.new(:scope<lexical>, :name<$total>)
),
QAST::Var.new(:scope<lexical>, :name<$total>)
),
303,
'contvar');
303,
'contvar');
}

is_qast(
QAST::CompUnit.new(
Expand Down
43 changes: 28 additions & 15 deletions t/serialization/02-types.t
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,18 @@ sub add_to_sc($sc, $idx, $obj) {
my $instance := nqp::box_i(147, $type);
add_to_sc($sc, 1, $instance);

my $serialized := nqp::serialize($sc, $sh);
if nqp::getcomp('nqp').backend.name eq 'jvm' {
todo("bigints are TODO on JVM", 1);
ok(0);
} else {
my $serialized := nqp::serialize($sc, $sh);

my $dsc := nqp::createsc('TEST_SC_8_OUT');
my $cr := nqp::list();
nqp::deserialize($serialized, $dsc, $sh, $cr, nqp::null());
my $dsc := nqp::createsc('TEST_SC_8_OUT');
my $cr := nqp::list();
nqp::deserialize($serialized, $dsc, $sh, $cr, nqp::null());

ok(nqp::unbox_i(nqp::scgetobj($dsc, 1)) == 147, "can unbox serialized bigint");
ok(nqp::unbox_i(nqp::scgetobj($dsc, 1)) == 147, "can unbox serialized bigint");
}
}

# Serializing a type with box_target attribute and P6bigint type
Expand Down Expand Up @@ -322,16 +327,24 @@ sub add_to_sc($sc, $idx, $obj) {

add_to_sc($sc, 3, $type);

my $serialized := nqp::serialize($sc, $sh);

my $dsc := nqp::createsc('TEST_SC_9_OUT');
my $cr := nqp::list();
nqp::deserialize($serialized, $dsc, $sh, $cr, nqp::null());

ok(nqp::unbox_i(nqp::box_i(7, nqp::scgetobj($dsc, 0))) == 7, "can use deserialized type for boxing");
ok(nqp::unbox_i(nqp::box_i(8, nqp::scgetobj($dsc, 3))) == 8, "can use deserialized type for boxing");
ok(nqp::unbox_i(nqp::scgetobj($dsc, 1)) == 4, "can unbox bigint obj");
ok(nqp::unbox_i(nqp::scgetobj($dsc, 2)) == 5, "can unbox autoboxed bigint obj");
if nqp::getcomp('nqp').backend.name eq 'jvm' {
todo("bigints are TODO on JVM", 4);
ok(0);
ok(0);
ok(0);
ok(0);
} else {
my $serialized := nqp::serialize($sc, $sh);

my $dsc := nqp::createsc('TEST_SC_9_OUT');
my $cr := nqp::list();
nqp::deserialize($serialized, $dsc, $sh, $cr, nqp::null());

ok(nqp::unbox_i(nqp::box_i(7, nqp::scgetobj($dsc, 0))) == 7, "can use deserialized type for boxing");
ok(nqp::unbox_i(nqp::box_i(8, nqp::scgetobj($dsc, 3))) == 8, "can use deserialized type for boxing");
ok(nqp::unbox_i(nqp::scgetobj($dsc, 1)) == 4, "can unbox bigint obj");
ok(nqp::unbox_i(nqp::scgetobj($dsc, 2)) == 5, "can unbox autoboxed bigint obj");
}
}

# Serializing a parameterized type
Expand Down

0 comments on commit 61b3f00

Please sign in to comment.