From 1cbd3db144a64adb1e77e9422c34fdc719438c2d Mon Sep 17 00:00:00 2001 From: Eugen Konkov Date: Sun, 6 Apr 2025 13:06:54 -0400 Subject: [PATCH] Check UTF is not broken --- t/47postgres-utf8.t | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 t/47postgres-utf8.t diff --git a/t/47postgres-utf8.t b/t/47postgres-utf8.t new file mode 100644 index 00000000..e51ba995 --- /dev/null +++ b/t/47postgres-utf8.t @@ -0,0 +1,30 @@ +use utf8; +use strict; +use warnings; + +use Test::More; +use SQL::Translator; + + +# Create a new translator object +my $translator = SQL::Translator->new( + from => 'PostgreSQL', + to => 'PostgreSQL', + quote_identifiers => 0, +); + +# Input PostgreSQL schema as a string (you can also use a file) +my $ddl = <translate( \$ddl ) + or die "Translation failed: " . $translator->error; + +$ddl =~ s/\s//sg; +$out =~ s/^--.*|\s//mg; + +is $out, $ddl, "UTF is not broken"; + +done_testing();