| 1 |
#!perl |
| 2 |
|
| 3 |
use strict; |
| 4 |
use warnings; |
| 5 |
use Test::More tests => 6; |
| 6 |
|
| 7 |
use XS::APItest; |
| 8 |
|
| 9 |
sub foo () { "abc" } |
| 10 |
|
| 11 |
sub bar { } |
| 12 |
|
| 13 |
is(XS::APItest::gv_const_sv(*foo), "abc", "on const glob"); |
| 14 |
is(XS::APItest::gv_const_sv("foo"), "abc", "on const by name"); |
| 15 |
is(XS::APItest::gv_const_sv($::{"foo"}), "abc", "on const by lookup"); |
| 16 |
is(XS::APItest::gv_const_sv(*bar), undef, "on non-const glob"); |
| 17 |
is(XS::APItest::gv_const_sv("bar"), undef, "on non-const by name"); |
| 18 |
is(XS::APItest::gv_const_sv($::{"bar"}), undef, "on non-const by lookup"); |