Subject: | Virtual table tests depend on enhanced query syntax availability |
When sqlite is compiled without enhanced query syntax, the tests output error:
t/virtual_table/11_filecontent_fulltext.t ............. 1/15
# Failed test 'search '"use strict" AND "use warnings"''
# at t/virtual_table/11_filecontent_fulltext.t line 79.
# Structures begin differing at:
# $got->[1] = 'lib/DBD/SQLite/VirtualTable.pm'
# $expected->[1] = 'lib/DBD/SQLite/Constants.pm'
# Failed test 'search '"use strict" AND "use warnings"' -- no lib/DBD/SQLite/VirtualTable.pm'
# at t/virtual_table/11_filecontent_fulltext.t line 92.
# Structures begin differing at:
# $got->[1] = 'lib/DBD/SQLite/VirtualTable/FileContent.pm'
# $expected->[1] = 'lib/DBD/SQLite/Constants.pm'
# Failed test 'search '"use strict" AND "use warnings"' -- after reconnect'
# at t/virtual_table/11_filecontent_fulltext.t line 105.
# Structures begin differing at:
# $got->[1] = 'lib/DBD/SQLite/VirtualTable/FileContent.pm'
# $expected->[1] = 'lib/DBD/SQLite/Constants.pm'
# Looks like you failed 3 tests of 15.
t/virtual_table/11_filecontent_fulltext.t ............. Dubious, test returned 3 (wstat 768, 0x300)
Failed 3/15 subtests
The problem is that the word 'AND' in term '"use strict" AND "use warnings"' is taken literally, and the file Constants.pm does not contain it.
There are different ways of fixing the issue, I'm attaching patch I plan to use for Solaris distribution. It would be great to have it in official release.
Thank you
__
Vlad
Subject: | fix_test.patch |
--- DBD-SQLite-1.48/t/virtual_table/11_filecontent_fulltext.t 2016-01-29 16:02:04.277869372 -0800
+++ DBD-SQLite-1.48/t/virtual_table/11_filecontent_fulltext.t 2016-01-29 16:02:01.854470748 -0800
@@ -39,6 +39,14 @@ my @tests = (
]],
);
+# The last set of tests tries to use enhanced query syntax. But when SQLite is
+# compiled without it's support, the work 'AND' is taken literally. The only
+# file not containing word 'AND' is Constants.pm.
+if ( not grep { $_ eq 'ENABLE_FTS3_PARENTHESIS' } DBD::SQLite::compile_options() ) {
+ my $arref = $tests[3];
+ @$arref = grep { $_ ne 'lib/DBD/SQLite/Constants.pm' } @$arref;
+}
+
plan tests => 3 + 3 * @tests;
# find out perl files in this distrib