DBD-PO

 view release on metacpan or  search on metacpan

t/03_DBD-PO/01_create_table.t  view on Meta::CPAN

#!perl -T

use strict;
use warnings;

use Carp qw(croak);
use English qw(-no_match_vars $OS_ERROR $INPUT_RECORD_SEPARATOR);
use Test::DBD::PO::Defaults qw(
    $PATH $EOL $SEPARATOR $TRACE
    trace_file_name
    $TABLE_0X
    $FILE_0X
);
use Test::More tests => 6 + 1;
use Test::NoWarnings;
use Test::Differences;

BEGIN {
    require_ok('DBI');
}

my $dbh = DBI->connect(
    "dbi:PO:f_dir=$PATH;po_eol=$EOL;po_separator=$SEPARATOR;po_charset=utf-8",
    undef,
    undef,
    {
        RaiseError => 1,
        PrintError => 0,
        AutoCommit => 1,
    },
);
isa_ok($dbh, 'DBI::db', 'connect');

if ($TRACE) {
    open my $file, '>', trace_file_name();
    $dbh->trace(4, $file);
}

my $result = $dbh->do(<<"EO_SQL");
    CREATE TABLE $TABLE_0X (
        comment    VARCHAR,
        automatic  VARCHAR,
        reference  VARCHAR,
        obsolete   INTEGER,
        fuzzy      INTEGER,
        msgctxt    VARCHAR,
        msgid      VARCHAR,
        msgstr     VARCHAR
    )
EO_SQL
is($result, '0E0', 'create table');
ok(-e $TABLE_0X, 'table file found');

my @parameters = (
    join(
        $SEPARATOR,
        qw(
            comment1
            comment2
        ),
    ),
    $dbh->func(
        [
            'Testproject',
            [
                'Bug Reporter',
                'bug@example.org',
            ],
            'no POT creation date',
            'no PO revision date',
            [
                'Steffen Winkler',
                'steffenw@example.org',
            ],
            [
                'MyTeam',



( run in 1.563 second using v1.01-cache-2.11-cpan-d8267643d1d )