From: Peter Rabbitson Date: Mon, 28 Jan 2013 21:48:05 +0000 (+0100) Subject: Hit an MC hash-order bug - simplify create, and solve it another time X-Git-Tag: v0.08240~20 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=742280c7076fd54993896f070e86d84c4e7dd585;p=dbsrgits%2FDBIx-Class.git Hit an MC hash-order bug - simplify create, and solve it another time (test saved and augmented in another branch) --- diff --git a/t/prefetch/manual.t b/t/prefetch/manual.t index 7a22245..9e6ea91 100644 --- a/t/prefetch/manual.t +++ b/t/prefetch/manual.t @@ -8,6 +8,18 @@ use DBICTest; my $schema = DBICTest->init_schema(no_populate => 1); +$schema->resultset('Artist')->create({ name => 'JMJ', cds => [{ + title => 'Magnetic Fields', + year => 1981, + genre => { name => 'electro' }, + tracks => [ + { title => 'm1' }, + { title => 'm2' }, + { title => 'm3' }, + { title => 'm4' }, + ], +} ] }); + $schema->resultset('CD')->create({ title => 'Equinoxe', year => 1978, @@ -23,22 +35,7 @@ $schema->resultset('CD')->create({ cd => { title => 'Oxygene', year => 1976, - artist => { - name => 'JMJ', - cds => [ - { - title => 'Magnetic Fields', - year => 1981, - genre => { name => 'electro' }, - tracks => [ - { title => 'm1' }, - { title => 'm2' }, - { title => 'm3' }, - { title => 'm4' }, - ], - }, - ], - }, + artist => { name => 'JMJ' }, tracks => [ { title => 'o2', position => 2}, # the position should not be here, bug in MC ], diff --git a/t/resultset/inflate_result_api.t b/t/resultset/inflate_result_api.t index e57492b..d97e475 100644 --- a/t/resultset/inflate_result_api.t +++ b/t/resultset/inflate_result_api.t @@ -7,6 +7,18 @@ use DBICTest; my $schema = DBICTest->init_schema(no_populate => 1); +$schema->resultset('Artist')->create({ name => 'JMJ', cds => [{ + title => 'Magnetic Fields', + year => 1981, + genre => { name => 'electro' }, + tracks => [ + { title => 'm1' }, + { title => 'm2' }, + { title => 'm3' }, + { title => 'm4' }, + ], +} ] }); + $schema->resultset('CD')->create({ title => 'Equinoxe', year => 1978, @@ -22,22 +34,7 @@ $schema->resultset('CD')->create({ cd => { title => 'Oxygene', year => 1976, - artist => { - name => 'JMJ', - cds => [ - { - title => 'Magnetic Fields', - year => 1981, - genre => { name => 'electro' }, - tracks => [ - { title => 'm1' }, - { title => 'm2' }, - { title => 'm3' }, - { title => 'm4' }, - ], - }, - ], - }, + artist => { name => 'JMJ' }, tracks => [ { title => 'o2', position => 2}, # the position should not be needed here, bug in MC ],