Ticket #1005: hash_eq.pir

File hash_eq.pir, 0.8 KB (added by flh, 5 years ago)

Failing example

Line 
1# Copyright (C) 2006-2009, Parrot Foundation.
2# $Id: skeleton.pir 38369 2009-04-26 12:57:09Z fperrad $
3
4.sub main :main
5    .local pmc array, hash
6    array = new ['ResizablePMCArray']
7    hash = new ['Hash']
8
9    array[0] = "hello"
10    array[1] = 1
11    array[2] = 3.5
12
13    $P0 = new ['ResizablePMCArray']
14    $P0[0] = "hello"
15    $P1 = box 1
16    $P0[1] = $P1
17    $P0[2] = 3.5
18
19    # Dies because MMD fails
20    $I0 = iseq $P0, array
21    say "is_equal with array"
22    say $I0
23
24    hash['one'] = "hello"
25    hash['two'] = 1
26    hash['three'] = 3.5
27
28    $P3 = clone hash
29    # Also dies because of MMD failure
30    $I0 = iseq $P3, hash
31    say "is_equal with hash"
32    say $I0
33.end
34
35# Local Variables:
36#   mode: pir
37#   fill-column: 100
38# End:
39# vim: expandtab shiftwidth=4 ft=pir:
40