-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the date of first edition to the pmh export
- Loading branch information
Showing
3 changed files
with
65 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!perl | ||
use strict; | ||
use warnings; | ||
|
||
|
||
BEGIN { | ||
$ENV{DBIX_CONFIG_DIR} = "t"; | ||
}; | ||
|
||
use Test::More tests => 4; | ||
use File::Spec::Functions qw/catfile catdir/; | ||
use lib catdir(qw/t lib/); | ||
use AmuseWiki::Tests qw/create_site/; | ||
use AmuseWikiFarm::Schema; | ||
use Test::WWW::Mechanize::Catalyst; | ||
use Data::Dumper::Concise; | ||
use Path::Tiny; | ||
|
||
my $schema = AmuseWikiFarm::Schema->connect('amuse'); | ||
my $site = create_site($schema, '0year0'); | ||
|
||
my $mech = Test::WWW::Mechanize::Catalyst->new(catalyst_app => 'AmuseWikiFarm', | ||
host => $site->canonical); | ||
|
||
foreach my $uri (qw/f-f-first/) { | ||
my $file = path($site->repo_root, qw/f ff/, "$uri.muse"); | ||
$file->parent->mkpath; | ||
my $muse = <<"MUSE"; | ||
#author <Author> | ||
#topics <Topic> | ||
#authors Author | ||
#lang en | ||
#date laskdf 2023 | ||
#datefirst lasdf 1932 | ||
MUSE | ||
$file->spew_utf8($muse); | ||
} | ||
|
||
|
||
$site->update_db_from_tree(sub { diag @_ }); | ||
|
||
|
||
my $title = $site->titles->first; | ||
is $title->date, "laskdf 2023"; | ||
is $title->datefirst, "lasdf 1932"; | ||
is $title->date_year, 2023; | ||
is $title->year_first_edition, 1932; | ||
|
||
diag "TODO: document in the manual the #datefirst"; | ||
|