use ReDIF::Writer;

use Test;

BEGIN{  plan tests => 6; }

ok( 1 );

my $template = {
    'template-type' => ['ReDIF-Paper 1.0'],
    'handle'        => ['RePEc:wop:aarhec:some_asdf'],
    'creation-date' => [ '1999-08-12' ],
    'title'	    => [ 'A testing paper template' ],
    'author' => 
    [
     { name => [ 'Edik Burilkin' ],
       handle => [ 'RePEc:per:1933-03-03:EDIK_BURILKIN'],
       workplace =>
       [
        {
         name => ['Kurchatov Institut'],
         handle => [ 'RePEc:edi:kurchru' ],
        },
        {
         name => ['Berkley'],
         handle => ['RePEc:edi:berklus'],
        }
       ]
       },

     { name => [ 'Burik Doilkin' ],
       handle => [ 'RePEc:per:1933-03-03:BURIK_DOILKIN'],
       workplace =>
       [
        {
         name => ['RTI'],
         handle => ['RePEc:edi:mrti_by'],
        }
       ]
       },
    ]

  };

my $string = ReDIF::Writer::stringify_template( $template ) ;

ok( 2 );

# print $string;

ok( $string =~ /\nauthor\-workplace\-handle: RePEc:edi:berklus\n/i );
ok( $string !~ /ARRAY/ );
ok( $string !~ /HASH/ );
ok( $string =~ /\nauthor-name: Burik Doilkin\n/i );
