2 # Copyright (C) 2001-2010, Parrot Foundation.
7 t/pmc/prop.t - Properties
15 Tests property access on PMCs.
20 .include 'test_more.pir'
23 setprop_getprop_tests()
32 .sub setprop_getprop_tests
37 setprop $P0, "en", $P1
40 setprop $P0, "de", $P2
41 is($P0, "10", "setprop is ok")
42 getprop $P3, "en", $P0
43 is($P3, "ten", "getprop is ok")
44 getprop $P3, "de", $P0
45 is($P3, "zehn", "getprop is ok")
48 .sub prop_vals_are_refs
61 getprop $P2, "Black", $P0
62 is($P2, "No", "'Black' property refers to right string")
63 getprop $P2, "Brown", $P0
64 is($P2, "No", "'Brown' property refers to same string as 'Black'")
68 new $P0, ['ResizablePMCArray']
77 is($P2, "Integer", "'Type' property successfully set to Integer'")
81 is($P2, "Float", "'Type' property successfully changed to Float'")
88 getprop $P2, "Wibble", $P1
90 is($I2, 0, "unset property isn't defined")
98 setprop $P0, "en", $P1
101 setprop $P0, "de", $P2
103 getprop $P3, "en", $P0
105 getprop $P3, "de", $P0
106 is($P3, "zehn", "ok")
108 getprop $P3, "de", $P0
110 ok(0, "'de' property not deleted")
113 ok(1, "'de' property deleted")
122 setprop $P0, "en", $P1
125 setprop $P0, "de", $P2
128 is($S0, "ten", "getprop via prophash works")
130 is($S0, "zehn", "getprop via prophash works")
132 is($S0, "", "getprop via prophash works for unset prop")
139 # vim: expandtab shiftwidth=4 ft=pir: