File: replace.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 (14 lines) | stat: -rw-r--r-- 359 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use strict;
use warnings;

use SQL::SplitStatement;

use Test::More tests => 2;

for my $verb (qw/INSERT REPLACE/) {
  my $sql = "$verb into mac.cache(keymd5,ts,data) VALUES (?,?,?);";

  my ($stmt, $placeholders) = SQL::SplitStatement->new->split_with_placeholders($sql);

  is_deeply $placeholders, [ 3 ], "$verb statement counts placeholders correctly";
}