[svn:parrot] r48244 - trunk/t/library
pmichaud at svn.parrot.org
pmichaud at svn.parrot.org
Sun Aug 1 06:29:51 UTC 2010
Author: pmichaud
Date: Sun Aug 1 06:29:50 2010
New Revision: 48244
URL: https://trac.parrot.org/parrot/changeset/48244
Log:
[p6object]: Add tests that .ACCEPTS return a boolean result.
Modified:
trunk/t/library/p6object.t
Modified: trunk/t/library/p6object.t
==============================================================================
--- trunk/t/library/p6object.t Sat Jul 31 23:52:57 2010 (r48243)
+++ trunk/t/library/p6object.t Sun Aug 1 06:29:50 2010 (r48244)
@@ -26,7 +26,7 @@
test_namespace.'export_to'(curr_namespace, exports)
## set our plan
- plan(295)
+ plan(303)
## make sure we can load the P6object library
push_eh load_fail
@@ -79,6 +79,20 @@
$I0 = can abcobj, 'new'
nok($I0, '! <can ABC_obj, "new" >')
+ ## verify .ACCEPTS method
+ $P0 = hashproto.'ACCEPTS'(hashobj)
+ ok($P0, 'Hash.ACCEPTS(Hash_obj)')
+ isa_ok($P0, 'Boolean', 'Boolean')
+ $P0 = hashproto.'ACCEPTS'(abcobj)
+ nok($P0, 'Hash.ACCEPTS(Abc_obj)')
+ isa_ok($P0, 'Boolean', 'Boolean')
+ $P0 = abcproto.'ACCEPTS'(hashobj)
+ nok($P0, 'ABC.ACCEPTS(Hash_obj)')
+ isa_ok($P0, 'Boolean', 'Boolean')
+ $P0 = abcproto.'ACCEPTS'(abcobj)
+ ok($P0, 'ABCh.ACCEPTS(Abc_obj)')
+ isa_ok($P0, 'Boolean', 'Boolean')
+
## create new class by namespace
.local pmc ghins, ghiproto, ghiobj
ghins = get_hll_namespace ['GHI']
More information about the parrot-commits
mailing list