From 7e0009e96a152603c79f42b4067c3ec5a20a00d4 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 24 Feb 2022 14:21:33 +0100 Subject: [PATCH] Bug 32030: fix test builder for boolean assume that tinyint are boolean (not really true but shouldn't hurt) Signed-off-by: Jonathan Field Signed-off-by: Martin Renvoize Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- t/lib/TestBuilder.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/t/lib/TestBuilder.pm b/t/lib/TestBuilder.pm index f648af7f41..e066c2facb 100644 --- a/t/lib/TestBuilder.pm +++ b/t/lib/TestBuilder.pm @@ -451,7 +451,7 @@ sub _should_be_fk { sub _gen_type { return { - tinyint => \&_gen_int, + tinyint => \&_gen_bool, smallint => \&_gen_int, mediumint => \&_gen_int, integer => \&_gen_int, @@ -482,6 +482,11 @@ sub _gen_type { }; }; +sub _gen_bool { + my ($self, $params) = @_; + return int( rand(2) ); +} + sub _gen_int { my ($self, $params) = @_; my $data_type = $params->{info}->{data_type}; -- 2.39.5