1
0
Fork 0
mirror of https://github.com/DBD-SQLite/DBD-SQLite synced 2025-06-08 06:38:12 -04:00

Adding failing test for the asymmetric unicode bug

This commit is contained in:
Adam Kennedy 2009-04-05 23:56:09 +00:00
parent 788904db72
commit 690d7472f3

View file

@ -0,0 +1,27 @@
#!/usr/bin/perl
use strict;
BEGIN {
$| = 1;
$^W = 1;
}
use t::lib::Test;
use Test::More tests => 15;
use Test::NoWarnings;
my $dbh = connect_ok();
$dbh->{unicode} = 1;
ok( $dbh->do(<<'END_SQL'), 'CREATE TABLE' );
CREATE TABLE foo (
bar varchar(255)
)
END_SQL
foreach ( "\0", "A", "\xe9", "\x{20ac}" ) {
ok( $dbh->do("INSERT INTO foo VALUES ( ? )", {}, $_), 'INSERT' );
my $foo = $dbh->selectall_arrayref("SELECT bar FROM foo");
is_deeply( $foo, [ [ $_ ] ], 'Value round-tripped ok' );
ok( $dbh->do("DELETE FROM foo"), 'DELETE ok' );
}