tagged release 0.7.1
[parrot.git] / compilers / nqp / t / 19-hash_access.t
blob0ae4f2a5236f2367090c5f3cc7ec67ffed5372d3
1 #!./parrot nqp.pbc
3 # check hash access methods
5 plan(7);
7 my %h;
9 %h<a> := 1;
10 say("ok 1 # hash assignment with numeric value doesn't barf");
12 say('ok ', %h<a> + 1, ' # hash access to numeric value');
14 %h<a> := 'ok 3';
15 say(%h<a>, ' # hash access to string value');
17 %h{1} := '4';
18 say('ok ', %h{1}, ' # numeric hash access');
20 say('ok ', %h<1> + 1, ' # numbers stringify');
22 %h{'b'} := 'ok 6 # single quoted curly braces work';
23 say(%h{'b'});
25 %h{"foo"} := "ok 7 # double quoted curly braces work";
26 say(%h{"foo"});