diff --git a/.gitignore b/.gitignore index cc26ed0..e442fbf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ .*.sw? \.DS_Store .prove +local/ +cpanfile +cpanfile.snapshot diff --git a/lib/DBIx/Class/Fixtures.pm b/lib/DBIx/Class/Fixtures.pm index 81b2569..36f8d0e 100644 --- a/lib/DBIx/Class/Fixtures.pm +++ b/lib/DBIx/Class/Fixtures.pm @@ -898,6 +898,7 @@ sub dump_object { # do the actual dumping my $serialized = Dump(\%ds)->Out(); + $file->print($serialized); } diff --git a/t/19-populate-unicode.t b/t/19-populate-unicode.t new file mode 100644 index 0000000..ab5fce1 --- /dev/null +++ b/t/19-populate-unicode.t @@ -0,0 +1,53 @@ +#!perl + +use DBIx::Class::Fixtures; +use Test::More no_plan; +use lib qw(t/lib); +use DBICTest; +use Path::Class; +use Data::Dumper; +use IO::All; +use utf8; + +# set up and populate schema +ok( my $schema = DBICTest->init_schema(), 'got schema' ); +my $config_dir = io->catfile(qw't var configs')->name; + +# do dump +ok( + my $fixtures = DBIx::Class::Fixtures->new( + { + config_dir => $config_dir, + debug => 0 + } + ), + 'object created with correct config dir' +); + +DBICTest->clear_schema($schema); +DBICTest->populate_schema($schema); + +ok( + $fixtures->dump( + { + schema => $schema, + directory => io->catfile(qw't var fixtures')->name, + config => "unicode.json", + } + ), + "unicode dump executed okay" +); + +$fixtures->populate( + { + connection_details => [ 'dbi:SQLite:' . io->catfile(qw[ t var DBIxClass.db ])->name, '', '' ], + directory => io->catfile(qw't var fixtures')->name, + schema => $schema, + no_deploy => 1, + use_find_or_create => 1, + } +); + +my $cd = $schema->resultset('CD')->find( { cdid => 5 }); + +is($cd->title, "Unicode Chars ™ © • † ∑ α β « » → …", "Unicode chars found"); diff --git a/t/lib/.DBICTest.pm.un~ b/t/lib/.DBICTest.pm.un~ new file mode 100755 index 0000000..8c8e96b Binary files /dev/null and b/t/lib/.DBICTest.pm.un~ differ diff --git a/t/lib/DBICTest.pm b/t/lib/DBICTest.pm index 08c0e27..19f7398 100755 --- a/t/lib/DBICTest.pm +++ b/t/lib/DBICTest.pm @@ -5,6 +5,8 @@ use strict; use warnings; use DBICTest::Schema; +use utf8; + =head1 NAME DBICTest - Library to be used by DBIx::Class test scripts. @@ -60,7 +62,7 @@ sub init_schema { my $schema; - my @connect_info = ($dsn, $dbuser, $dbpass, { AutoCommit => 1 }); + my @connect_info = ($dsn, $dbuser, $dbpass, { AutoCommit => 1, sqlite_unicode => 1 }); if ($args{compose_connection}) { $schema = DBICTest::Schema->compose_connection( @@ -158,8 +160,8 @@ sub populate_schema { [ 2, 1, "Forkful of bees", 2001 ], [ 3, 1, "Caterwaulin' Blues", 1997 ], [ 4, 2, "Generic Manufactured Singles", 2001 ], - [ 5, 2, "We like girls and stuff", 2003 ], - [ 6, 3, "Come Be Depressed With Us", 1998 ], + [ 5, 2, "Unicode Chars ™ © • † ∑ α β « » → …", 2015 ], + [ 6, 3, "Übertreibung älterer Umlaute", 1998 ], ]); $schema->populate('Tag', [ diff --git a/t/var/DBIxClass.db b/t/var/DBIxClass.db new file mode 100644 index 0000000..0341702 Binary files /dev/null and b/t/var/DBIxClass.db differ diff --git a/t/var/DBIxClassDifferent.db b/t/var/DBIxClassDifferent.db new file mode 100644 index 0000000..67aef5c Binary files /dev/null and b/t/var/DBIxClassDifferent.db differ diff --git a/t/var/configs/unicode.json b/t/var/configs/unicode.json new file mode 100644 index 0000000..adc21a6 --- /dev/null +++ b/t/var/configs/unicode.json @@ -0,0 +1,12 @@ +{ + "might_have": { + "fetch": 0 + }, + "has_many": { + "fetch": 0 + }, + "sets": [{ + "class": "CD", + "quantity": "all" + }] +} diff --git a/t/var/fixtures/CD/1.fix b/t/var/fixtures/CD/1.fix new file mode 100644 index 0000000..b7f372b --- /dev/null +++ b/t/var/fixtures/CD/1.fix @@ -0,0 +1,6 @@ +$HASH1 = { + artist => 1, + cdid => 1, + title => 'Spoonful of bees', + year => 1999 + }; diff --git a/t/var/fixtures/CD/2.fix b/t/var/fixtures/CD/2.fix new file mode 100644 index 0000000..a6b679a --- /dev/null +++ b/t/var/fixtures/CD/2.fix @@ -0,0 +1,6 @@ +$HASH1 = { + artist => 1, + cdid => 2, + title => 'Forkful of bees', + year => 2001 + }; diff --git a/t/var/fixtures/CD/3.fix b/t/var/fixtures/CD/3.fix new file mode 100644 index 0000000..96c1068 --- /dev/null +++ b/t/var/fixtures/CD/3.fix @@ -0,0 +1,6 @@ +$HASH1 = { + artist => 1, + cdid => 3, + title => 'Caterwaulin\' Blues', + year => 1997 + }; diff --git a/t/var/fixtures/CD/4.fix b/t/var/fixtures/CD/4.fix new file mode 100644 index 0000000..26d5952 --- /dev/null +++ b/t/var/fixtures/CD/4.fix @@ -0,0 +1,6 @@ +$HASH1 = { + artist => 2, + cdid => 4, + title => 'Generic Manufactured Singles', + year => 2001 + }; diff --git a/t/var/fixtures/CD/5.fix b/t/var/fixtures/CD/5.fix new file mode 100644 index 0000000..0912382 --- /dev/null +++ b/t/var/fixtures/CD/5.fix @@ -0,0 +1,6 @@ +$HASH1 = { + artist => 2, + cdid => 5, + title => "Unicode Chars \x{2122} \251 \x{2022} \x{2020} \x{2211} \x{3b1} \x{3b2} \253 \273 \x{2192} \x{2026}", + year => 2015 + }; diff --git a/t/var/fixtures/CD/6.fix b/t/var/fixtures/CD/6.fix new file mode 100644 index 0000000..11a0d17 --- /dev/null +++ b/t/var/fixtures/CD/6.fix @@ -0,0 +1,6 @@ +$HASH1 = { + artist => 3, + cdid => 6, + title => "\334bertreibung \344lterer Umlaute", + year => 1998 + }; diff --git a/t/var/fixtures/_config_set b/t/var/fixtures/_config_set new file mode 100644 index 0000000..32a5aae --- /dev/null +++ b/t/var/fixtures/_config_set @@ -0,0 +1,17 @@ +$VAR1 = { + 'sets' => [ + { + 'class' => 'CD', + 'quantity' => 'all' + } + ], + 'might_have' => { + 'fetch' => 0 + }, + 'has_many' => { + 'fetch' => 0 + }, + 'belongs_to' => { + 'fetch' => 1 + } + }; diff --git a/t/var/fixtures/_dumper_version b/t/var/fixtures/_dumper_version new file mode 100644 index 0000000..85690d1 --- /dev/null +++ b/t/var/fixtures/_dumper_version @@ -0,0 +1 @@ +1.001029 \ No newline at end of file diff --git a/t/var/fixtures/artist/1.fix b/t/var/fixtures/artist/1.fix new file mode 100644 index 0000000..cd82bac --- /dev/null +++ b/t/var/fixtures/artist/1.fix @@ -0,0 +1,4 @@ +$HASH1 = { + artistid => 1, + name => 'Caterwauler McCrae' + }; diff --git a/t/var/fixtures/artist/2.fix b/t/var/fixtures/artist/2.fix new file mode 100644 index 0000000..997aaaf --- /dev/null +++ b/t/var/fixtures/artist/2.fix @@ -0,0 +1,4 @@ +$HASH1 = { + artistid => 2, + name => 'Random Boy Band' + }; diff --git a/t/var/fixtures/artist/3.fix b/t/var/fixtures/artist/3.fix new file mode 100644 index 0000000..d117d39 --- /dev/null +++ b/t/var/fixtures/artist/3.fix @@ -0,0 +1,4 @@ +$HASH1 = { + artistid => 3, + name => 'We Are Goth' + }; diff --git a/t/var/fixtures/excludes/CD/1.fix b/t/var/fixtures/excludes/CD/1.fix new file mode 100644 index 0000000..b7f372b --- /dev/null +++ b/t/var/fixtures/excludes/CD/1.fix @@ -0,0 +1,6 @@ +$HASH1 = { + artist => 1, + cdid => 1, + title => 'Spoonful of bees', + year => 1999 + }; diff --git a/t/var/fixtures/excludes/CD/2.fix b/t/var/fixtures/excludes/CD/2.fix new file mode 100644 index 0000000..a6b679a --- /dev/null +++ b/t/var/fixtures/excludes/CD/2.fix @@ -0,0 +1,6 @@ +$HASH1 = { + artist => 1, + cdid => 2, + title => 'Forkful of bees', + year => 2001 + }; diff --git a/t/var/fixtures/excludes/CD/3.fix b/t/var/fixtures/excludes/CD/3.fix new file mode 100644 index 0000000..96c1068 --- /dev/null +++ b/t/var/fixtures/excludes/CD/3.fix @@ -0,0 +1,6 @@ +$HASH1 = { + artist => 1, + cdid => 3, + title => 'Caterwaulin\' Blues', + year => 1997 + }; diff --git a/t/var/fixtures/excludes/CD/4.fix b/t/var/fixtures/excludes/CD/4.fix new file mode 100644 index 0000000..26d5952 --- /dev/null +++ b/t/var/fixtures/excludes/CD/4.fix @@ -0,0 +1,6 @@ +$HASH1 = { + artist => 2, + cdid => 4, + title => 'Generic Manufactured Singles', + year => 2001 + }; diff --git a/t/var/fixtures/excludes/CD/5.fix b/t/var/fixtures/excludes/CD/5.fix new file mode 100644 index 0000000..0912382 --- /dev/null +++ b/t/var/fixtures/excludes/CD/5.fix @@ -0,0 +1,6 @@ +$HASH1 = { + artist => 2, + cdid => 5, + title => "Unicode Chars \x{2122} \251 \x{2022} \x{2020} \x{2211} \x{3b1} \x{3b2} \253 \273 \x{2192} \x{2026}", + year => 2015 + }; diff --git a/t/var/fixtures/excludes/CD/6.fix b/t/var/fixtures/excludes/CD/6.fix new file mode 100644 index 0000000..11a0d17 --- /dev/null +++ b/t/var/fixtures/excludes/CD/6.fix @@ -0,0 +1,6 @@ +$HASH1 = { + artist => 3, + cdid => 6, + title => "\334bertreibung \344lterer Umlaute", + year => 1998 + }; diff --git a/t/var/fixtures/excludes/_config_set b/t/var/fixtures/excludes/_config_set new file mode 100644 index 0000000..00370ca --- /dev/null +++ b/t/var/fixtures/excludes/_config_set @@ -0,0 +1,33 @@ +$VAR1 = { + 'sets' => [ + { + 'quantity' => 'all', + 'class' => 'Producer' + }, + { + 'quantity' => 'all', + 'class' => 'CD' + }, + { + 'quantity' => 'all', + 'class' => 'Artist' + }, + { + 'quantity' => 'all', + 'class' => 'Track' + }, + { + 'quantity' => 'all', + 'class' => 'CD_to_Producer' + } + ], + 'belongs_to' => { + 'fetch' => 0 + }, + 'has_many' => { + 'fetch' => 0 + }, + 'might_have' => { + 'fetch' => 0 + } + }; diff --git a/t/var/fixtures/excludes/_dumper_version b/t/var/fixtures/excludes/_dumper_version new file mode 100644 index 0000000..85690d1 --- /dev/null +++ b/t/var/fixtures/excludes/_dumper_version @@ -0,0 +1 @@ +1.001029 \ No newline at end of file diff --git a/t/var/fixtures/excludes/artist/1.fix b/t/var/fixtures/excludes/artist/1.fix new file mode 100644 index 0000000..cd82bac --- /dev/null +++ b/t/var/fixtures/excludes/artist/1.fix @@ -0,0 +1,4 @@ +$HASH1 = { + artistid => 1, + name => 'Caterwauler McCrae' + }; diff --git a/t/var/fixtures/excludes/artist/2.fix b/t/var/fixtures/excludes/artist/2.fix new file mode 100644 index 0000000..997aaaf --- /dev/null +++ b/t/var/fixtures/excludes/artist/2.fix @@ -0,0 +1,4 @@ +$HASH1 = { + artistid => 2, + name => 'Random Boy Band' + }; diff --git a/t/var/fixtures/excludes/artist/3.fix b/t/var/fixtures/excludes/artist/3.fix new file mode 100644 index 0000000..d117d39 --- /dev/null +++ b/t/var/fixtures/excludes/artist/3.fix @@ -0,0 +1,4 @@ +$HASH1 = { + artistid => 3, + name => 'We Are Goth' + }; diff --git a/t/var/fixtures/excludes/artist/32948.fix b/t/var/fixtures/excludes/artist/32948.fix new file mode 100644 index 0000000..f8f2fce --- /dev/null +++ b/t/var/fixtures/excludes/artist/32948.fix @@ -0,0 +1,4 @@ +$HASH1 = { + artistid => 32948, + name => 'Big PK' + }; diff --git a/t/var/fixtures/excludes/artist/4.fix b/t/var/fixtures/excludes/artist/4.fix new file mode 100644 index 0000000..479e5ea --- /dev/null +++ b/t/var/fixtures/excludes/artist/4.fix @@ -0,0 +1,4 @@ +$HASH1 = { + artistid => 4, + name => '' + }; diff --git a/t/var/fixtures/excludes/cd_to_producer/1-1.fix b/t/var/fixtures/excludes/cd_to_producer/1-1.fix new file mode 100644 index 0000000..c08f3b2 --- /dev/null +++ b/t/var/fixtures/excludes/cd_to_producer/1-1.fix @@ -0,0 +1,4 @@ +$HASH1 = { + cd => 1, + producer => 1 + }; diff --git a/t/var/fixtures/excludes/cd_to_producer/1-2.fix b/t/var/fixtures/excludes/cd_to_producer/1-2.fix new file mode 100644 index 0000000..58f94f1 --- /dev/null +++ b/t/var/fixtures/excludes/cd_to_producer/1-2.fix @@ -0,0 +1,4 @@ +$HASH1 = { + cd => 1, + producer => 2 + }; diff --git a/t/var/fixtures/excludes/cd_to_producer/1-3.fix b/t/var/fixtures/excludes/cd_to_producer/1-3.fix new file mode 100644 index 0000000..c9ed9a5 --- /dev/null +++ b/t/var/fixtures/excludes/cd_to_producer/1-3.fix @@ -0,0 +1,4 @@ +$HASH1 = { + cd => 1, + producer => 3 + }; diff --git a/t/var/fixtures/excludes/cd_to_producer/2-1.fix b/t/var/fixtures/excludes/cd_to_producer/2-1.fix new file mode 100644 index 0000000..f19c713 --- /dev/null +++ b/t/var/fixtures/excludes/cd_to_producer/2-1.fix @@ -0,0 +1,4 @@ +$HASH1 = { + cd => 2, + producer => 1 + }; diff --git a/t/var/fixtures/excludes/cd_to_producer/2-2.fix b/t/var/fixtures/excludes/cd_to_producer/2-2.fix new file mode 100644 index 0000000..00981e1 --- /dev/null +++ b/t/var/fixtures/excludes/cd_to_producer/2-2.fix @@ -0,0 +1,4 @@ +$HASH1 = { + cd => 2, + producer => 2 + }; diff --git a/t/var/fixtures/excludes/cd_to_producer/3-3.fix b/t/var/fixtures/excludes/cd_to_producer/3-3.fix new file mode 100644 index 0000000..fb5b464 --- /dev/null +++ b/t/var/fixtures/excludes/cd_to_producer/3-3.fix @@ -0,0 +1,4 @@ +$HASH1 = { + cd => 3, + producer => 3 + }; diff --git a/t/var/fixtures/excludes/producer/1.fix b/t/var/fixtures/excludes/producer/1.fix new file mode 100644 index 0000000..a8964e1 --- /dev/null +++ b/t/var/fixtures/excludes/producer/1.fix @@ -0,0 +1,4 @@ +$HASH1 = { + name => 'Matt S Trout', + producerid => 1 + }; diff --git a/t/var/fixtures/excludes/producer/2.fix b/t/var/fixtures/excludes/producer/2.fix new file mode 100644 index 0000000..a3b207b --- /dev/null +++ b/t/var/fixtures/excludes/producer/2.fix @@ -0,0 +1,4 @@ +$HASH1 = { + name => 'Bob The Builder', + producerid => 2 + }; diff --git a/t/var/fixtures/excludes/producer/3.fix b/t/var/fixtures/excludes/producer/3.fix new file mode 100644 index 0000000..b01cc0d --- /dev/null +++ b/t/var/fixtures/excludes/producer/3.fix @@ -0,0 +1,4 @@ +$HASH1 = { + name => 'Fred The Phenotype', + producerid => 3 + }; diff --git a/t/var/fixtures/excludes/track/10.fix b/t/var/fixtures/excludes/track/10.fix new file mode 100644 index 0000000..e6e9afd --- /dev/null +++ b/t/var/fixtures/excludes/track/10.fix @@ -0,0 +1,9 @@ +$HASH1 = { + cd => 4, + last_updated_on + => undef, + position + => 1, + title => 'Boring Name', + trackid => 10 + }; diff --git a/t/var/fixtures/excludes/track/11.fix b/t/var/fixtures/excludes/track/11.fix new file mode 100644 index 0000000..5b19269 --- /dev/null +++ b/t/var/fixtures/excludes/track/11.fix @@ -0,0 +1,9 @@ +$HASH1 = { + cd => 4, + last_updated_on + => undef, + position + => 2, + title => 'Boring Song', + trackid => 11 + }; diff --git a/t/var/fixtures/excludes/track/12.fix b/t/var/fixtures/excludes/track/12.fix new file mode 100644 index 0000000..418ccdc --- /dev/null +++ b/t/var/fixtures/excludes/track/12.fix @@ -0,0 +1,9 @@ +$HASH1 = { + cd => 4, + last_updated_on + => undef, + position + => 3, + title => 'No More Ideas', + trackid => 12 + }; diff --git a/t/var/fixtures/excludes/track/13.fix b/t/var/fixtures/excludes/track/13.fix new file mode 100644 index 0000000..b42ba45 --- /dev/null +++ b/t/var/fixtures/excludes/track/13.fix @@ -0,0 +1,9 @@ +$HASH1 = { + cd => 5, + last_updated_on + => undef, + position + => 1, + title => 'Sad', + trackid => 13 + }; diff --git a/t/var/fixtures/excludes/track/14.fix b/t/var/fixtures/excludes/track/14.fix new file mode 100644 index 0000000..1fcd807 --- /dev/null +++ b/t/var/fixtures/excludes/track/14.fix @@ -0,0 +1,9 @@ +$HASH1 = { + cd => 5, + last_updated_on + => undef, + position + => 2, + title => 'Under The Weather', + trackid => 14 + }; diff --git a/t/var/fixtures/excludes/track/15.fix b/t/var/fixtures/excludes/track/15.fix new file mode 100644 index 0000000..8b82fd2 --- /dev/null +++ b/t/var/fixtures/excludes/track/15.fix @@ -0,0 +1,9 @@ +$HASH1 = { + cd => 5, + last_updated_on + => undef, + position + => 3, + title => 'Suicidal', + trackid => 15 + }; diff --git a/t/var/fixtures/excludes/track/16.fix b/t/var/fixtures/excludes/track/16.fix new file mode 100644 index 0000000..2f5d4aa --- /dev/null +++ b/t/var/fixtures/excludes/track/16.fix @@ -0,0 +1,9 @@ +$HASH1 = { + cd => 1, + last_updated_on + => undef, + position + => 1, + title => 'The Bees Knees', + trackid => 16 + }; diff --git a/t/var/fixtures/excludes/track/17.fix b/t/var/fixtures/excludes/track/17.fix new file mode 100644 index 0000000..d5accd5 --- /dev/null +++ b/t/var/fixtures/excludes/track/17.fix @@ -0,0 +1,9 @@ +$HASH1 = { + cd => 1, + last_updated_on + => undef, + position + => 2, + title => 'Apiary', + trackid => 17 + }; diff --git a/t/var/fixtures/excludes/track/18.fix b/t/var/fixtures/excludes/track/18.fix new file mode 100644 index 0000000..abc8e4c --- /dev/null +++ b/t/var/fixtures/excludes/track/18.fix @@ -0,0 +1,9 @@ +$HASH1 = { + cd => 1, + last_updated_on + => undef, + position + => 3, + title => 'Beehind You', + trackid => 18 + }; diff --git a/t/var/fixtures/excludes/track/4.fix b/t/var/fixtures/excludes/track/4.fix new file mode 100644 index 0000000..8699ddc --- /dev/null +++ b/t/var/fixtures/excludes/track/4.fix @@ -0,0 +1,9 @@ +$HASH1 = { + cd => 2, + last_updated_on + => undef, + position + => 1, + title => 'Stung with Success', + trackid => 4 + }; diff --git a/t/var/fixtures/excludes/track/5.fix b/t/var/fixtures/excludes/track/5.fix new file mode 100644 index 0000000..1b8cdb4 --- /dev/null +++ b/t/var/fixtures/excludes/track/5.fix @@ -0,0 +1,9 @@ +$HASH1 = { + cd => 2, + last_updated_on + => undef, + position + => 2, + title => 'Stripy', + trackid => 5 + }; diff --git a/t/var/fixtures/excludes/track/6.fix b/t/var/fixtures/excludes/track/6.fix new file mode 100644 index 0000000..5ad6ff4 --- /dev/null +++ b/t/var/fixtures/excludes/track/6.fix @@ -0,0 +1,9 @@ +$HASH1 = { + cd => 2, + last_updated_on + => undef, + position + => 3, + title => 'Sticky Honey', + trackid => 6 + }; diff --git a/t/var/fixtures/excludes/track/7.fix b/t/var/fixtures/excludes/track/7.fix new file mode 100644 index 0000000..7d1ffd8 --- /dev/null +++ b/t/var/fixtures/excludes/track/7.fix @@ -0,0 +1,9 @@ +$HASH1 = { + cd => 3, + last_updated_on + => undef, + position + => 1, + title => 'Yowlin', + trackid => 7 + }; diff --git a/t/var/fixtures/excludes/track/8.fix b/t/var/fixtures/excludes/track/8.fix new file mode 100644 index 0000000..1e5a7fd --- /dev/null +++ b/t/var/fixtures/excludes/track/8.fix @@ -0,0 +1,9 @@ +$HASH1 = { + cd => 3, + last_updated_on + => undef, + position + => 2, + title => 'Howlin', + trackid => 8 + }; diff --git a/t/var/fixtures/excludes/track/9.fix b/t/var/fixtures/excludes/track/9.fix new file mode 100644 index 0000000..3679235 --- /dev/null +++ b/t/var/fixtures/excludes/track/9.fix @@ -0,0 +1,9 @@ +$HASH1 = { + cd => 3, + last_updated_on + => '2007-10-20 00:00:00', + position + => 3, + title => 'Fowlin', + trackid => 9 + }; diff --git a/t/var/fixtures/multi/date.json/CD/3.fix b/t/var/fixtures/multi/date.json/CD/3.fix new file mode 100644 index 0000000..96c1068 --- /dev/null +++ b/t/var/fixtures/multi/date.json/CD/3.fix @@ -0,0 +1,6 @@ +$HASH1 = { + artist => 1, + cdid => 3, + title => 'Caterwaulin\' Blues', + year => 1997 + }; diff --git a/t/var/fixtures/multi/date.json/_config_set b/t/var/fixtures/multi/date.json/_config_set new file mode 100644 index 0000000..005a557 --- /dev/null +++ b/t/var/fixtures/multi/date.json/_config_set @@ -0,0 +1,20 @@ +$VAR1 = { + 'sets' => [ + { + 'class' => 'Track', + 'ids' => [ + '9' + ] + } + ], + 'belongs_to' => { + 'fetch' => 1 + }, + 'has_many' => { + 'fetch' => 0 + }, + 'might_have' => { + 'fetch' => 0 + }, + 'datetime_relative' => '2007-10-30 00:00:00' + }; diff --git a/t/var/fixtures/multi/date.json/_dumper_version b/t/var/fixtures/multi/date.json/_dumper_version new file mode 100644 index 0000000..85690d1 --- /dev/null +++ b/t/var/fixtures/multi/date.json/_dumper_version @@ -0,0 +1 @@ +1.001029 \ No newline at end of file diff --git a/t/var/fixtures/multi/date.json/artist/1.fix b/t/var/fixtures/multi/date.json/artist/1.fix new file mode 100644 index 0000000..cd82bac --- /dev/null +++ b/t/var/fixtures/multi/date.json/artist/1.fix @@ -0,0 +1,4 @@ +$HASH1 = { + artistid => 1, + name => 'Caterwauler McCrae' + }; diff --git a/t/var/fixtures/multi/date.json/track/9.fix b/t/var/fixtures/multi/date.json/track/9.fix new file mode 100644 index 0000000..f9c9e67 --- /dev/null +++ b/t/var/fixtures/multi/date.json/track/9.fix @@ -0,0 +1,19 @@ +$HASH1 = { + cd => 3, + last_updated_on + => { + days => -10, + end_of_month + => 'wrap', + minutes => 0, + months => 0, + nanoseconds + => 0, + seconds => 0 + }, + position + => 3, + title => 'Fowlin', + trackid => 9 + }; +bless( $HASH1->{last_updated_on}, 'DateTime::Duration' ); diff --git a/t/var/fixtures/multi/rules.json/CD/2.fix b/t/var/fixtures/multi/rules.json/CD/2.fix new file mode 100644 index 0000000..a6b679a --- /dev/null +++ b/t/var/fixtures/multi/rules.json/CD/2.fix @@ -0,0 +1,6 @@ +$HASH1 = { + artist => 1, + cdid => 2, + title => 'Forkful of bees', + year => 2001 + }; diff --git a/t/var/fixtures/multi/rules.json/CD/5.fix b/t/var/fixtures/multi/rules.json/CD/5.fix new file mode 100644 index 0000000..0912382 --- /dev/null +++ b/t/var/fixtures/multi/rules.json/CD/5.fix @@ -0,0 +1,6 @@ +$HASH1 = { + artist => 2, + cdid => 5, + title => "Unicode Chars \x{2122} \251 \x{2022} \x{2020} \x{2211} \x{3b1} \x{3b2} \253 \273 \x{2192} \x{2026}", + year => 2015 + }; diff --git a/t/var/fixtures/multi/rules.json/_config_set b/t/var/fixtures/multi/rules.json/_config_set new file mode 100644 index 0000000..2cc6621 --- /dev/null +++ b/t/var/fixtures/multi/rules.json/_config_set @@ -0,0 +1,54 @@ +$VAR1 = { + 'might_have' => { + 'fetch' => 0 + }, + 'rules' => { + 'might_have' => { + 'fetch' => 0 + }, + 'CD' => { + 'join' => [ + 'tags' + ], + 'fetch' => [ + { + 'cond' => { + 'position' => 2 + }, + 'rel' => 'tracks' + } + ], + 'cond' => [ + { + 'tags.tag' => 'Cheesy' + } + ] + } + }, + 'sets' => [ + { + 'ids' => [ + '5' + ], + 'class' => 'CD' + }, + { + 'ids' => [ + '1' + ], + 'fetch' => [ + { + 'rel' => 'cds', + 'quantity' => 'all' + } + ], + 'class' => 'Artist' + } + ], + 'belongs_to' => { + 'fetch' => 1 + }, + 'has_many' => { + 'fetch' => 0 + } + }; diff --git a/t/var/fixtures/multi/rules.json/_dumper_version b/t/var/fixtures/multi/rules.json/_dumper_version new file mode 100644 index 0000000..85690d1 --- /dev/null +++ b/t/var/fixtures/multi/rules.json/_dumper_version @@ -0,0 +1 @@ +1.001029 \ No newline at end of file diff --git a/t/var/fixtures/multi/rules.json/artist/1.fix b/t/var/fixtures/multi/rules.json/artist/1.fix new file mode 100644 index 0000000..cd82bac --- /dev/null +++ b/t/var/fixtures/multi/rules.json/artist/1.fix @@ -0,0 +1,4 @@ +$HASH1 = { + artistid => 1, + name => 'Caterwauler McCrae' + }; diff --git a/t/var/fixtures/multi/rules.json/artist/2.fix b/t/var/fixtures/multi/rules.json/artist/2.fix new file mode 100644 index 0000000..997aaaf --- /dev/null +++ b/t/var/fixtures/multi/rules.json/artist/2.fix @@ -0,0 +1,4 @@ +$HASH1 = { + artistid => 2, + name => 'Random Boy Band' + }; diff --git a/t/var/fixtures/multi/rules.json/track/14.fix b/t/var/fixtures/multi/rules.json/track/14.fix new file mode 100644 index 0000000..1fcd807 --- /dev/null +++ b/t/var/fixtures/multi/rules.json/track/14.fix @@ -0,0 +1,9 @@ +$HASH1 = { + cd => 5, + last_updated_on + => undef, + position + => 2, + title => 'Under The Weather', + trackid => 14 + }; diff --git a/t/var/fixtures/multi/rules.json/track/5.fix b/t/var/fixtures/multi/rules.json/track/5.fix new file mode 100644 index 0000000..1b8cdb4 --- /dev/null +++ b/t/var/fixtures/multi/rules.json/track/5.fix @@ -0,0 +1,9 @@ +$HASH1 = { + cd => 2, + last_updated_on + => undef, + position + => 2, + title => 'Stripy', + trackid => 5 + }; diff --git a/t/var/fixtures/test_file b/t/var/fixtures/test_file new file mode 100644 index 0000000..bdf08de --- /dev/null +++ b/t/var/fixtures/test_file @@ -0,0 +1 @@ +test file \ No newline at end of file