~ubuntu-branches/ubuntu/oneiric/libdbd-csv-perl/oneiric

« back to all changes in this revision

Viewing changes to t/80_rt.t

  • Committer: Bazaar Package Importer
  • Author(s): Ansgar Burchardt, Ansgar Burchardt, gregor herrmann
  • Date: 2010-07-10 01:06:31 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20100710010631-zf6egt78rkbj794q
Tags: 0.3000-1
[ Ansgar Burchardt ]
* New upstream release.
* Drop patch spelling.patch: Applied upstream.
* Bump Standards-Version to 3.9.0 (no changes).
* Add myself to Uploaders.

[ gregor herrmann ]
* Bump versioned (build) dependency on libsql-statement-perl to 1.27
  (recommended by upstream).

Show diffs side-by-side

added added

removed removed

Lines of Context:
149
149
    ok ($dbh = Connect ({ raw_headers => 1 }),                  "connect");
150
150
    ok ($sth = $dbh->prepare ("select * from rt$rt"),           "prepare");
151
151
    # $sth is `empty' and should fail on all actions
152
 
    is ($sth->{NAME_lc}, undef,                                 "field names");
 
152
    $sth->{NAME_lc}     # this can return undef or an empty list
 
153
        ? is_deeply ($sth->{NAME_lc}, [],                       "field names")
 
154
        : is ($sth->{NAME_lc}, undef,                           "field names");
153
155
    ok ($sth->finish,                                           "finish");
154
156
 
155
157
    ok ($dbh->do ("drop table rt$rt"),                          "drop table");
190
192
    ok ($sth->execute ("Tux", 2),               "update");
191
193
    ok ($sth->finish,                           "finish");
192
194
 
193
 
    open my $fh, "<".DbFile ("RT$rt.csv");
 
195
    my $rtfn          = DbFile ("RT$rt.csv");
 
196
    -f $rtfn or $rtfn = DbFile ("rt$rt.csv");
 
197
    ok (-f $rtfn,                               "file $rtfn exists");
 
198
    ok (-s $rtfn,                               "file is not empty");
 
199
    open my $fh, "< $rtfn";
 
200
    ok ($fh,                                    "open file");
194
201
    binmode $fh;
195
202
    is (scalar <$fh>, qq{name,id\r\n},          "Field names");
196
203
    is (scalar <$fh>, qq{Tim,1\r\n},            "Record 1");
214
221
    close FILE;
215
222
 
216
223
    ok (my $dbh = Connect ({ f_lock => 0 }),                                    "connect");
217
 
    ok (my $sth = $dbh->prepare ("select * from rt$rt"),        "prepare");
218
224
    $dbh->{csv_tables}{rt51090}{types} = [ @dbitp ];
 
225
    ok (my $sth = $dbh->prepare ("select * from rt$rt"),        "prepare");
219
226
    is_deeply ($dbh->{csv_tables}{rt51090}{types}, \@dbitp,     "set types (@dbitp)");
220
227
 
221
228
    ok ($sth->execute (),                                       "execute");