diff --git a/t/blessing.t b/t/blessing.t new file mode 100644 index 0000000..9b6bd1d --- /dev/null +++ b/t/blessing.t @@ -0,0 +1,17 @@ +use Test; +use lib 't/lib'; +use lib:from 't/lib'; +use C:from; + +todo('Not yet implemented', 5); +is(C.blessed_hash, 42); +is(C.blessed_array[1], 42); +is($(C.blessed_scalar), 42); +ok("foo\n" ~~ C.blessed_regex); +is(C.blessed_sub, 42); + +# Not sure how to do this. +# … C.blessed_typeglob … + +done-testing; + diff --git a/t/lib/C.pm b/t/lib/C.pm new file mode 100644 index 0000000..8eceafc --- /dev/null +++ b/t/lib/C.pm @@ -0,0 +1,12 @@ +package C; + +sub blessed_hash { bless { foo => 42 }, __PACKAGE__ } +sub blessed_array { bless [ foo, 42 ], __PACKAGE__ } +sub blessed_scalar { bless \(my $x = 42), __PACKAGE__ } +sub blessed_regex { bless qr/foo$/, __PACKAGE__ } +sub blessed_sub { bless sub { return 42 }, __PACKAGE__ } + +# Not sure how to do this. +#sub blessed_typeglob { bless …, __PACKAGE__ } + +1;