File: 94-exception.t

package info (click to toggle)
libsql-splitstatement-perl 1.00023-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 484 kB
  • sloc: perl: 3,384; sql: 1,478; makefile: 2
file content (38 lines) | stat: -rw-r--r-- 716 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
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env perl

use strict;
use warnings;

use SQL::SplitStatement;

use Test::More;

BEGIN {
    unless ( eval 'use Test::Exception; 1' ) {
        plan skip_all => "please install Test::Exception to run these tests"
    }
}

plan tests => 3;

throws_ok {
    my $sql_splitter = SQL::SplitStatement->new({
        keep_terminator  => 1,
        keep_terminators => 1
    })
} qr/can't be both assigned/,
'keep_terminator and keep_terminators both assigned';

lives_ok {
    my $sql_splitter = SQL::SplitStatement->new({
        keep_terminator  => 1
    })
}
'keep_terminator only';

lives_ok {
    my $sql_splitter = SQL::SplitStatement->new({
        keep_terminators  => 1
    })
}
'keep_terminators only';