Branch Coverage

blib/lib/DBIx/TempDB/Util.pm
Criterion Covered Total %
branch 26 52 50.0


line true false branch
20 5 10 unless &blessed($url)
21 0 15 unless $url->has_recognized_engine
25 8 7 if $engine eq 'mysql'
26 6 1 if $engine eq 'pg'
27 1 0 if $engine eq 'sqlite'
35 0 1 if $mode eq 'fork'
36 0 1 if $mode eq 'double_fork'
42 0 2 if &blessed($type)
43 2 0 if $type eq 'mysql'
75 0 6 if (my $service = delete $opt{'service'})
111 0 0 unless pipe my $READER, my $WRITER
114 0 0 if (my $pid_1 = fork // confess("Couldn't fork: $!"))
122 0 0 $pid_2 =~ /(\d+)/ ? :
124 0 0 unless $pid_2
135 0 0 unless POSIX::setsid() != -1
137 0 0 if (my $pid_2 = fork // die("[TempDB:$$] Couldn't fork: $!"))
158 0 0 unless pipe my $READER, my $WRITER
159 0 0 unless defined(my $pid = fork)
160 0 0 if $pid
189 5 72 if ($sql =~ /^$delimiter/x) { }
1 71 elsif ($sql =~ /^delimiter\s+(\S+)\s*(?:\n|\z)/ip) { }
55 16 elsif ($sql =~ /^(\s+)/s or $sql =~ /^(\w+)/) { }
5 11 elsif ($sql =~ /^--.*(?:\n|\z)/p or $sql =~ /^\#.*(?:\n|\z)/p or $sql =~ m[^/\*(?:[^\*]|\*[^/])*(?:\*/|\*\z|\z)]p or $sql =~ /^'(?:[^'\\]*|\\(?:.|\n)|'')*(?:'|\z)/p or $sql =~ /^"(?:[^"\\]*|\\(?:.|\n)|"")*(?:"|\z)/p or $sql =~ /^`(?:[^`]*|``)*(?:`|\z)/p) { }
216 6 71 if ($new) { }
217 6 0 unless $last =~ /^\s*$/s
225 1 1 unless $last =~ /^\s*$/s