2 # Copyright (C) 2007 - 2008, Parrot Foundation.
7 t/oo/methods.t - Test OO methods
11 % prove t/oo/methods.t
15 Tests features related to the creation, addition, and execution of OO methods.
20 .include 'test_more.pir'
26 loading_methods_from_file()
27 loading_methods_from_eval()
28 overridden_find_method()
36 .local string filename
38 filename = "method_library.pir"
39 file = open filename, 'w'
43 .sub 'bar_method' :method
56 $S0 = "method_library.pir"
60 .sub loading_methods_from_file
63 $I0 = $P1.'foo_method'()
64 ok ($I0, 'calling foo_method')
66 load_bytecode 'method_library.pir'
68 $I0 = $P1.'bar_method'()
69 ok ($I0, 'calling bar_method')
74 .sub 'foo_method' :method
79 .sub loading_methods_from_eval
83 $I0 = $P1.'foo_method'()
84 ok ($I0, 'calling foo_method')
88 .sub 'bar_method' :method
96 $I0 = $P1.'bar_method'()
97 ok ($I0, 'calling bar_method')
101 .sub 'foo_method' :method
106 .sub overridden_find_method
109 $I0 = $P2.'some_method'(42)
110 is ($I0, 42, 'calling overriden method')
120 .sub 'find_method' :vtable :method
121 .param string meth_name
123 .const 'Sub' meth = 'meth'
133 # vim: expandtab shiftwidth=4 ft=pir: