File: rt_96050_db_filename_for_a_closed_database.t

package info (click to toggle)
libdbd-sqlite3-perl 1.76-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,004 kB
  • sloc: ansic: 167,715; perl: 1,788; pascal: 277; makefile: 9
file content (23 lines) | stat: -rw-r--r-- 526 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env perl

use strict;
use warnings;
use lib "t/lib";
use SQLiteTest;
use Test::More;
use if -d ".git", "Test::FailWarnings";

my $dbh = connect_ok( RaiseError => 1, PrintError => 0 );
for my $func (@CALL_FUNCS) {
	my $filename = eval { $dbh->$func('db_filename') };
	ok !$@, "no filename (because it's in-memory); no error";
}

$dbh->disconnect;

for my $func (@CALL_FUNCS) {
	my $filename = eval { $dbh->$func('db_filename') };
	ok !$@ && !$filename, "got no error; no filename; and no segfault";
}

done_testing;