mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-28 08:51:44 +00:00
Updated tests for schema iterator
This commit is contained in:
@@ -9,7 +9,7 @@ BEGIN {
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
use English qw(-no_match_vars);
|
||||
use Test::More tests => 43;
|
||||
use Test::More tests => 42;
|
||||
|
||||
use SchemaIterator;
|
||||
use FileIterator;
|
||||
@@ -349,7 +349,7 @@ SKIP: {
|
||||
|
||||
test_so(
|
||||
files => ["$in/dump001.txt"],
|
||||
result => "",
|
||||
result => "test.a test.b test2.a ",
|
||||
test_name => "Iterate schema in dump001.txt",
|
||||
);
|
||||
|
||||
@@ -362,7 +362,7 @@ test_so(
|
||||
|
||||
test_so(
|
||||
files => ["$in/dump001.txt", "$in/dump001.txt"],
|
||||
result => "",
|
||||
result => "$out/multiple-files.txt",
|
||||
ddl => 1,
|
||||
test_name => "Iterate schema in multiple files",
|
||||
);
|
||||
@@ -370,7 +370,7 @@ test_so(
|
||||
test_so(
|
||||
files => ["$in/dump001.txt"],
|
||||
filters => [qw(--databases TEST2)],
|
||||
result => "",
|
||||
result => "$out/all-dbs-dump001.txt",
|
||||
test_name => "Filter dump file by --databases",
|
||||
);
|
||||
|
||||
@@ -591,7 +591,7 @@ my $si = new SchemaIterator(
|
||||
Quoter => $q,
|
||||
TableParser => $tp,
|
||||
);
|
||||
for my $db (qw( information_schema performance_schema|lost\+found percona percona_schema test )) {
|
||||
for my $db (qw( information_schema performance_schema|lost\+found percona percona_schema )) {
|
||||
is(
|
||||
$si->database_is_allowed($db),
|
||||
0,
|
||||
|
6
t/lib/samples/SchemaIterator/all-dbs-dump001.txt
Normal file
6
t/lib/samples/SchemaIterator/all-dbs-dump001.txt
Normal file
@@ -0,0 +1,6 @@
|
||||
test2.a
|
||||
CREATE TABLE `a` (
|
||||
`c1` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`c2` varchar(45) NOT NULL
|
||||
);
|
||||
|
38
t/lib/samples/SchemaIterator/multiple-files.txt
Normal file
38
t/lib/samples/SchemaIterator/multiple-files.txt
Normal file
@@ -0,0 +1,38 @@
|
||||
test.a
|
||||
CREATE TABLE `a` (
|
||||
`c1` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`c2` varchar(45) NOT NULL
|
||||
);
|
||||
|
||||
test.b
|
||||
CREATE TABLE `b` (
|
||||
`c1` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`c2` varchar(45) NOT NULL,
|
||||
`c3` varchar(45) NOT NULL,
|
||||
);
|
||||
|
||||
test2.a
|
||||
CREATE TABLE `a` (
|
||||
`c1` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`c2` varchar(45) NOT NULL
|
||||
);
|
||||
|
||||
test.a
|
||||
CREATE TABLE `a` (
|
||||
`c1` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`c2` varchar(45) NOT NULL
|
||||
);
|
||||
|
||||
test.b
|
||||
CREATE TABLE `b` (
|
||||
`c1` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`c2` varchar(45) NOT NULL,
|
||||
`c3` varchar(45) NOT NULL,
|
||||
);
|
||||
|
||||
test2.a
|
||||
CREATE TABLE `a` (
|
||||
`c1` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`c2` varchar(45) NOT NULL
|
||||
);
|
||||
|
Reference in New Issue
Block a user