From 6367db27848ea42be06968f63a0612089644debc Mon Sep 17 00:00:00 2001 From: Patrick Simon Date: Wed, 1 Apr 2015 11:38:39 +0200 Subject: [PATCH 1/3] example for utf8 encoding --- .gitignore | 3 +++ t/lib/DBICTest.pm | 6 ++++-- t/var/fixtures/CD/5.fix | 6 ++++++ 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 t/var/fixtures/CD/5.fix 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/t/lib/DBICTest.pm b/t/lib/DBICTest.pm index 08c0e27..8e4c560 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,7 +160,7 @@ 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 ], + [ 5, 2, "Wir übertreiben überhaupt nicht", 2003 ], [ 6, 3, "Come Be Depressed With Us", 1998 ], ]); diff --git a/t/var/fixtures/CD/5.fix b/t/var/fixtures/CD/5.fix new file mode 100644 index 0000000..7fb848f --- /dev/null +++ b/t/var/fixtures/CD/5.fix @@ -0,0 +1,6 @@ +$HASH1 = { + artist => 2, + cdid => 5, + title => "Wir \374bertreiben \374berhaupt nicht", + year => 2003 + }; From 593b3c236f6c977bd42827c3b18874bb86b1c645 Mon Sep 17 00:00:00 2001 From: Jens Gassmann Date: Sat, 11 Apr 2015 11:52:54 +0200 Subject: [PATCH 2/3] Adding a test for unicode --- lib/DBIx/Class/Fixtures.pm | 1 + t/19-populate-unicode.t | 53 ++++++++++++++++++++++++++++++++++++++ t/lib/DBICTest.pm | 2 +- t/var/configs/unicode.json | 12 +++++++++ t/var/fixtures/CD/5.fix | 4 +-- 5 files changed, 69 insertions(+), 3 deletions(-) create mode 100644 t/19-populate-unicode.t create mode 100644 t/var/configs/unicode.json 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 b/t/lib/DBICTest.pm index 8e4c560..69d0c74 100755 --- a/t/lib/DBICTest.pm +++ b/t/lib/DBICTest.pm @@ -160,7 +160,7 @@ sub populate_schema { [ 2, 1, "Forkful of bees", 2001 ], [ 3, 1, "Caterwaulin' Blues", 1997 ], [ 4, 2, "Generic Manufactured Singles", 2001 ], - [ 5, 2, "Wir übertreiben überhaupt nicht", 2003 ], + [ 5, 2, "Unicode Chars ™ © • † ∑ α β « » → …", 2015 ], [ 6, 3, "Come Be Depressed With Us", 1998 ], ]); 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/5.fix b/t/var/fixtures/CD/5.fix index 7fb848f..0912382 100644 --- a/t/var/fixtures/CD/5.fix +++ b/t/var/fixtures/CD/5.fix @@ -1,6 +1,6 @@ $HASH1 = { artist => 2, cdid => 5, - title => "Wir \374bertreiben \374berhaupt nicht", - year => 2003 + title => "Unicode Chars \x{2122} \251 \x{2022} \x{2020} \x{2211} \x{3b1} \x{3b2} \253 \273 \x{2192} \x{2026}", + year => 2015 }; From c2a9b18b0ef6864d0bc75e5c52f05d2cc896f00f Mon Sep 17 00:00:00 2001 From: Patrick Simon Date: Sat, 11 Apr 2015 13:54:26 +0200 Subject: [PATCH 3/3] unicode chars working, but german special chars giving errors --- t/lib/.DBICTest.pm.un~ | Bin 0 -> 15453 bytes t/lib/DBICTest.pm | 2 +- t/var/DBIxClass.db | Bin 0 -> 9216 bytes t/var/DBIxClassDifferent.db | Bin 0 -> 4096 bytes t/var/fixtures/CD/1.fix | 6 ++ t/var/fixtures/CD/2.fix | 6 ++ t/var/fixtures/CD/3.fix | 6 ++ t/var/fixtures/CD/4.fix | 6 ++ t/var/fixtures/CD/6.fix | 6 ++ t/var/fixtures/_config_set | 17 ++++++ t/var/fixtures/_dumper_version | 1 + t/var/fixtures/artist/1.fix | 4 ++ t/var/fixtures/artist/2.fix | 4 ++ t/var/fixtures/artist/3.fix | 4 ++ t/var/fixtures/excludes/CD/1.fix | 6 ++ t/var/fixtures/excludes/CD/2.fix | 6 ++ t/var/fixtures/excludes/CD/3.fix | 6 ++ t/var/fixtures/excludes/CD/4.fix | 6 ++ t/var/fixtures/excludes/CD/5.fix | 6 ++ t/var/fixtures/excludes/CD/6.fix | 6 ++ t/var/fixtures/excludes/_config_set | 33 +++++++++++ t/var/fixtures/excludes/_dumper_version | 1 + t/var/fixtures/excludes/artist/1.fix | 4 ++ t/var/fixtures/excludes/artist/2.fix | 4 ++ t/var/fixtures/excludes/artist/3.fix | 4 ++ t/var/fixtures/excludes/artist/32948.fix | 4 ++ t/var/fixtures/excludes/artist/4.fix | 4 ++ .../fixtures/excludes/cd_to_producer/1-1.fix | 4 ++ .../fixtures/excludes/cd_to_producer/1-2.fix | 4 ++ .../fixtures/excludes/cd_to_producer/1-3.fix | 4 ++ .../fixtures/excludes/cd_to_producer/2-1.fix | 4 ++ .../fixtures/excludes/cd_to_producer/2-2.fix | 4 ++ .../fixtures/excludes/cd_to_producer/3-3.fix | 4 ++ t/var/fixtures/excludes/producer/1.fix | 4 ++ t/var/fixtures/excludes/producer/2.fix | 4 ++ t/var/fixtures/excludes/producer/3.fix | 4 ++ t/var/fixtures/excludes/track/10.fix | 9 +++ t/var/fixtures/excludes/track/11.fix | 9 +++ t/var/fixtures/excludes/track/12.fix | 9 +++ t/var/fixtures/excludes/track/13.fix | 9 +++ t/var/fixtures/excludes/track/14.fix | 9 +++ t/var/fixtures/excludes/track/15.fix | 9 +++ t/var/fixtures/excludes/track/16.fix | 9 +++ t/var/fixtures/excludes/track/17.fix | 9 +++ t/var/fixtures/excludes/track/18.fix | 9 +++ t/var/fixtures/excludes/track/4.fix | 9 +++ t/var/fixtures/excludes/track/5.fix | 9 +++ t/var/fixtures/excludes/track/6.fix | 9 +++ t/var/fixtures/excludes/track/7.fix | 9 +++ t/var/fixtures/excludes/track/8.fix | 9 +++ t/var/fixtures/excludes/track/9.fix | 9 +++ t/var/fixtures/multi/date.json/CD/3.fix | 6 ++ t/var/fixtures/multi/date.json/_config_set | 20 +++++++ .../fixtures/multi/date.json/_dumper_version | 1 + t/var/fixtures/multi/date.json/artist/1.fix | 4 ++ t/var/fixtures/multi/date.json/track/9.fix | 19 ++++++ t/var/fixtures/multi/rules.json/CD/2.fix | 6 ++ t/var/fixtures/multi/rules.json/CD/5.fix | 6 ++ t/var/fixtures/multi/rules.json/_config_set | 54 ++++++++++++++++++ .../fixtures/multi/rules.json/_dumper_version | 1 + t/var/fixtures/multi/rules.json/artist/1.fix | 4 ++ t/var/fixtures/multi/rules.json/artist/2.fix | 4 ++ t/var/fixtures/multi/rules.json/track/14.fix | 9 +++ t/var/fixtures/multi/rules.json/track/5.fix | 9 +++ t/var/fixtures/test_file | 1 + 65 files changed, 466 insertions(+), 1 deletion(-) create mode 100755 t/lib/.DBICTest.pm.un~ create mode 100644 t/var/DBIxClass.db create mode 100644 t/var/DBIxClassDifferent.db create mode 100644 t/var/fixtures/CD/1.fix create mode 100644 t/var/fixtures/CD/2.fix create mode 100644 t/var/fixtures/CD/3.fix create mode 100644 t/var/fixtures/CD/4.fix create mode 100644 t/var/fixtures/CD/6.fix create mode 100644 t/var/fixtures/_config_set create mode 100644 t/var/fixtures/_dumper_version create mode 100644 t/var/fixtures/artist/1.fix create mode 100644 t/var/fixtures/artist/2.fix create mode 100644 t/var/fixtures/artist/3.fix create mode 100644 t/var/fixtures/excludes/CD/1.fix create mode 100644 t/var/fixtures/excludes/CD/2.fix create mode 100644 t/var/fixtures/excludes/CD/3.fix create mode 100644 t/var/fixtures/excludes/CD/4.fix create mode 100644 t/var/fixtures/excludes/CD/5.fix create mode 100644 t/var/fixtures/excludes/CD/6.fix create mode 100644 t/var/fixtures/excludes/_config_set create mode 100644 t/var/fixtures/excludes/_dumper_version create mode 100644 t/var/fixtures/excludes/artist/1.fix create mode 100644 t/var/fixtures/excludes/artist/2.fix create mode 100644 t/var/fixtures/excludes/artist/3.fix create mode 100644 t/var/fixtures/excludes/artist/32948.fix create mode 100644 t/var/fixtures/excludes/artist/4.fix create mode 100644 t/var/fixtures/excludes/cd_to_producer/1-1.fix create mode 100644 t/var/fixtures/excludes/cd_to_producer/1-2.fix create mode 100644 t/var/fixtures/excludes/cd_to_producer/1-3.fix create mode 100644 t/var/fixtures/excludes/cd_to_producer/2-1.fix create mode 100644 t/var/fixtures/excludes/cd_to_producer/2-2.fix create mode 100644 t/var/fixtures/excludes/cd_to_producer/3-3.fix create mode 100644 t/var/fixtures/excludes/producer/1.fix create mode 100644 t/var/fixtures/excludes/producer/2.fix create mode 100644 t/var/fixtures/excludes/producer/3.fix create mode 100644 t/var/fixtures/excludes/track/10.fix create mode 100644 t/var/fixtures/excludes/track/11.fix create mode 100644 t/var/fixtures/excludes/track/12.fix create mode 100644 t/var/fixtures/excludes/track/13.fix create mode 100644 t/var/fixtures/excludes/track/14.fix create mode 100644 t/var/fixtures/excludes/track/15.fix create mode 100644 t/var/fixtures/excludes/track/16.fix create mode 100644 t/var/fixtures/excludes/track/17.fix create mode 100644 t/var/fixtures/excludes/track/18.fix create mode 100644 t/var/fixtures/excludes/track/4.fix create mode 100644 t/var/fixtures/excludes/track/5.fix create mode 100644 t/var/fixtures/excludes/track/6.fix create mode 100644 t/var/fixtures/excludes/track/7.fix create mode 100644 t/var/fixtures/excludes/track/8.fix create mode 100644 t/var/fixtures/excludes/track/9.fix create mode 100644 t/var/fixtures/multi/date.json/CD/3.fix create mode 100644 t/var/fixtures/multi/date.json/_config_set create mode 100644 t/var/fixtures/multi/date.json/_dumper_version create mode 100644 t/var/fixtures/multi/date.json/artist/1.fix create mode 100644 t/var/fixtures/multi/date.json/track/9.fix create mode 100644 t/var/fixtures/multi/rules.json/CD/2.fix create mode 100644 t/var/fixtures/multi/rules.json/CD/5.fix create mode 100644 t/var/fixtures/multi/rules.json/_config_set create mode 100644 t/var/fixtures/multi/rules.json/_dumper_version create mode 100644 t/var/fixtures/multi/rules.json/artist/1.fix create mode 100644 t/var/fixtures/multi/rules.json/artist/2.fix create mode 100644 t/var/fixtures/multi/rules.json/track/14.fix create mode 100644 t/var/fixtures/multi/rules.json/track/5.fix create mode 100644 t/var/fixtures/test_file diff --git a/t/lib/.DBICTest.pm.un~ b/t/lib/.DBICTest.pm.un~ new file mode 100755 index 0000000000000000000000000000000000000000..8c8e96b6c6492437bc533a7151e0b3d53a72bb11 GIT binary patch literal 15453 zcmeI(OHWfl6bJAN)ED?h5#=?lsGwCr)Ij1!m5K@fbPe%f#wF=w-;FKaRv zi<6 zNd;Gy@G7-d>Uatbe>hLQ5x@MVw(<&|(Dt7zkn67hQQ-)JZ_RY> zi@brWprRmtLjwI(0j-N4qTMl|iJtK55IMtEJw-wMhI9sON*bWYV>}n%E-oaR!qAAk z;j5;iAbvxaY20blAqv5?$l6e>qM{&vLlSLH8l`{zsS7{ZU>nVrb)qXP<0U4~wu)zJ z`7HW^{>v-s(M0#3zVPsj7YWzm2Q|!oF>wa%F6v5)B6w{yLAoc0>U!F~)e|azmvw)Y zWm!npiR7WIvZ5e7%&Ea&;^zGAkH2iqt`@tfC-(Ll^5wi#2(nm{p;;Nn{RTRTTyC8@g0aSgMJu z|BMR6%_4CCE2=1n-_V6BR+o4(oODHpO<}l2L?20H*`5hjI@oO*9z9%I>C%!YZ9q~R2fA< z{Dv;Zj>vI^aqSH-tO&JzB2$Q}q9};p(52XJDXzJTi4lQ@J7S^+P(_TY;r)>iA0+K0 zX|oXJooH+bv;87fc&ec&h~Lm<*lHPyn+cf^WCui=;8a3U5Wk^|u*D)=y&aSV&M!dO@;m%{v5SXlmL;_A#)*%b2ECd!id>zhCD CPt^th literal 0 HcmV?d00001 diff --git a/t/lib/DBICTest.pm b/t/lib/DBICTest.pm index 69d0c74..19f7398 100755 --- a/t/lib/DBICTest.pm +++ b/t/lib/DBICTest.pm @@ -161,7 +161,7 @@ sub populate_schema { [ 3, 1, "Caterwaulin' Blues", 1997 ], [ 4, 2, "Generic Manufactured Singles", 2001 ], [ 5, 2, "Unicode Chars ™ © • † ∑ α β « » → …", 2015 ], - [ 6, 3, "Come Be Depressed With Us", 1998 ], + [ 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 0000000000000000000000000000000000000000..03417027fda90ecce4b9c5fa45a30c4147f7f1d3 GIT binary patch literal 9216 zcmeHNPiP!f7=QD=`IFh2v`IT|7aMpIYO}PVyRD^GQOw3o8=9mwyQSo`OlDrPLnkxq z>>KMIlx~sY!HXU|c_>8$5yXGD9$H!jq0n2s6tn~^h^QC!pdS3*Y_?<}g|>&9mU+y) z_x*b_-}~);Z{EMktJ9v~Y%z?MZNc^vl_&~%nK44hcDzlzyGchv?J`&@Yv{X?+sW8% zLzCK0O_P322bD>38UDRnmHU&oK{v9NrL;X^FZf*8OHFwj6LaP9YME8XOVed0C2Taq zB;mPiYPMQFT%Kdc=cZ=H=jPeb@;sY8R%Np%rlwLQ@ zYH`E01$S%s2uTQUnJ3N1rZCmW4h|}3cPCA8T*uXV8iD9YC>{46+_xj)HN}H?+2VGz zej76RWiYb2oYFp!c-VPICs%tsU46UswnN^7$AOJVto@Y{k(^>=^LeGcyoyLogtbN# zy0OC}$6d?Op7;0aR#96QjPBFcRj&P;jymoh*0s)O@-I+5dn~UIFL3!A&DVU4<(eIf zFyU*x4%CXhJjkf*$4rNt1pa|P;dl5MR**?kia?6MqmF>4gQ5Uv8WxnQDkvsZ0Zau{ zia7-ZOf!S6)Zu#>|9`-*a2tL=CQT^y zDZl?3d`0lfe*?aS%SfgvMIc3B<04?5Z9fYnSMrwF@uQ#u=^p?fBPTfR86FAq4PTR4MQ`;G5BC>gB{J(?1PjC%BgL5zmJ2r09Q_oTa z9v%Xtx<-^K3$A{+z#|cHZy^qr*wv4G3?dAm6U#nMwR!Q-q32%G&@#5@iNJG0m$M06 zBWkjhw=b|OpRkoP7w|sMR^EA!UH^hz|B_w#lwG;VR?fYT@{jiwiU*!iv3}X2hk3vw z&tWrm5HH$}h$HT@iWe;Tyt%JXC_V)mF^krnF!q97tmMbMiB25cPEonrnhc{;i?Pqb zMYg~@)p81I#;i&s41+Z)taM1m|7Lnk#{Uht1fRoscoRIR!i!LZCvm3m8~qX0X-W~; z=m-oA>BLk<2$VRl;{q6)599tpDa#Q$-tg?GwQUQsW}Z~*oS{{d9StzwvRTJf?_nGV zS7OicT-(nLNXcHJVMMza>eBusw?&;tnSNB6TZvY&UF!*Hwu`7R8?u=YzrIs0x0_ox zN%06#X(@~_cv&S3mWDF29tu}wv$)Xsv?&d9`vE4y)4msAh#wp)7RL4!SfTKIat-t) zCIsk_#H8PlkI503PuOj`RPQ7dD#CM4wb+p`;H?3zQ;E`wh`dHCr^-r2f~@SpPJ5!x zDzW46W>dz$2_F#n3x0uH*av(E7jYbL0Yzy_5l9jEUl7QcxDS_AE7*;-GJTS!3BAcc zI;Tz4vDa#C(j}v=GMZ#)hcQ)TEKQCKOpqibB$XtUWS^oE(~^{oe}HcYuKnM{B26g* zDFTle0v1mHi<5GyAjc`k>pTcWtHG01fKs@SNK3Kj<49&Rt^(|wv4vn2R*k|~$oMzN zD+I4w%CPb--An(5GxrC;W4l56us51F{?_~BbkJc#oE&+}FtWqLO8Z!HwxGMS-!1!k U&J%Q{$w`7P^B`v$)|_1V59!4f>Hq)$ literal 0 HcmV?d00001 diff --git a/t/var/DBIxClassDifferent.db b/t/var/DBIxClassDifferent.db new file mode 100644 index 0000000000000000000000000000000000000000..67aef5cdc87c8f974b7ec7c3afbdc41ce127029c GIT binary patch literal 4096 zcmeH|!AiqG5QcY?(BQ#C4^oPk@z#K1i!Wddp%l}oF&=tcvs+zBBW%}7kMS9NM!^^G z?50UeiqziQ9kRQVOyK|X!DR050xlVhU&Vw-xIh-d7+nG&gc@pDYAxeHCG~r}Ec|me z(Ak%Ls9rFQ9GRcSk2-YhJ%O2Nx7ux-_a&KDsVm82%Ep4TjF!9UMZO#R5W81_59KrH zK$UR{gE02{egwDCVCY68xb{a7-oy|-1i>jlMkWkqL?q8dbb8&cvno3Iv0=BGP5g1P zP)%q;tu?iT7D@@-u0n+5Qwcni?1_n$gwmH>rW*{X>YNd=!QBfk>6|ajl>+5%teLE& zmC-WWZuSonr|3;=ej|11&;&GrT_tdYP1N& 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/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