From: Alex Beamish Date: Mon, 9 Sep 2013 14:30:32 +0000 (-0400) Subject: Update test script X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d53746106ebddecc73d39f9817a5a9e45b7ef4b4;p=dbsrgits%2FDBIx-Class-Historic.git Update test script This version just updates the original version with slightly more information so that more DBIx::Class functionality is revealed. --- diff --git a/examples/Schema/testdb.pl b/examples/Schema/testdb.pl index 2a1061a..32cbd6d 100755 --- a/examples/Schema/testdb.pl +++ b/examples/Schema/testdb.pl @@ -53,7 +53,8 @@ sub get_tracks_by_artist { } ); while (my $track = $rs->next) { - print $track->title . "\n"; + print $track->title . " (from the CD '" . $track->cd->title + . "')\n"; } print "\n"; } @@ -70,7 +71,7 @@ sub get_cd_by_track { } ); my $cd = $rs->first; - print $cd->title . "\n\n"; + print $cd->title . " has the track '$tracktitle'.\n\n"; } sub get_cds_by_artist { @@ -104,7 +105,7 @@ sub get_artist_by_track { } ); my $artist = $rs->first; - print $artist->name . "\n\n"; + print $artist->name . " recorded the track '$tracktitle'.\n\n"; } sub get_artist_by_cd { @@ -119,5 +120,5 @@ sub get_artist_by_cd { } ); my $artist = $rs->first; - print $artist->name . "\n\n"; + print $artist->name . " recorded the CD '$cdtitle'.\n\n"; } diff --git a/lib/DBIx/Class/Manual/Example.pod b/lib/DBIx/Class/Manual/Example.pod index baf6294..2659083 100644 --- a/lib/DBIx/Class/Manual/Example.pod +++ b/lib/DBIx/Class/Manual/Example.pod @@ -86,24 +86,25 @@ When this script is run, it should output the following: Dirty Diana get_tracks_by_artist(Michael Jackson): - Billie Jean - Leave Me Alone - Smooth Criminal - Beat It - Dirty Diana + Billie Jean (from the CD 'Thriller') + Leave Me Alone (from the CD 'Bad') + Smooth Criminal (from the CD 'Bad') + Beat It (from the CD 'Thriller') + Dirty Diana (from the CD 'Bad') get_cd_by_track(Stan): - The Marshall Mathers LP + The Marshall Mathers LP has the track 'Stan'. get_cds_by_artist(Michael Jackson): Thriller Bad get_artist_by_track(Dirty Diana): - Michael Jackson + Michael Jackson recorded the track 'Dirty Diana'. get_artist_by_cd(The Marshall Mathers LP): - Eminem + Eminem recorded the CD 'The Marshall Mathers LP'. + =head3 Discussion about the results