Skip to content

Commit

Permalink
Increased code coverage for Undef PMC
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrajca committed Dec 30, 2010
1 parent d6c805a commit 3d53ab3
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion t/pmc/undef.t
Expand Up @@ -18,16 +18,18 @@ Tests mainly morphing undef to other types.
.sub main :main
.include 'test_more.pir'

plan(24)
plan(27)

morph_to_string()
undef_pmc_is_false()
undef_pmc_is_not_defined()
undef_pmc_morph_to_string()
undef_pmc_morph_to_integer()
undef_pmc_morph_to_float()
verify_equality()
string_pmc_morph_to_undef()
undef_pmc_set_to_integer_native()
undef_pmc_set_to_number_native()
undef_pmc_isa_after_assignment()
check_whether_interface_is_done()
verify_clone_works()
Expand Down Expand Up @@ -105,6 +107,17 @@ Tests mainly morphing undef to other types.
is( float1, -7777.777000, 'PMC Undef morph to int then float' )
.end

.sub verify_equality
.local pmc pmc1
pmc1 = new ['Undef']

.local pmc pmc2
pmc2 = new ['String']

$I0 = pmc1 == pmc2
is( $I0, 0, 'PMC Undef and PMC String are unequal' )
.end

.sub string_pmc_morph_to_undef
.local pmc pmc1
pmc1 = new ['String']
Expand All @@ -125,6 +138,16 @@ Tests mainly morphing undef to other types.
ok( pmc1_is_a, 'PMC Undef set to int isa Integer' )
.end

.sub undef_pmc_set_to_number_native
.local pmc pmc1
pmc1 = new ['Undef']
pmc1 = 52.23
is( pmc1, 52.23, 'PMC Undef set to float gives float' )

$I0 = isa pmc1, "Float"
ok( $I0, 'PMC Undef set to float isa Float' )
.end

.sub undef_pmc_isa_after_assignment
.local pmc pmc1
pmc1 = new ['Undef']
Expand Down

0 comments on commit 3d53ab3

Please sign in to comment.