After some flabbergasted investigation, I finally figured out what the
problem is that prevents the test from passing.
Your scheme of translating only those statements that SQLFairy
understands, and passing through the rest unchanged, is a great one -
except it looks as though about 2005 or 2006, SQLFairy started *parsing*
INSERT commands without *handling* them. The result is that it returns
a BEGIN TRANSACTION and COMMIT TRANSACTION wrapped around a blank
statement for the SQLite insert, and your pass-through code therefore
doesn't emit an INSERT, and the test for having the right number of rows
in the table thus fails.
The cheap fix is to use REPLACE INTO in the test, which isn't picked up
by the SQLFairy parser but has the same effect in the test, and allows a
pass. A better fix would be to avoid sending INSERT to SQLFairy in the
first place, which is sadly less elegant than your solution but has the
advantage of working when schemas include INSERT to load the tables.
The reason CPANtesters list passing tests, by the way, is that the tests
don't run on machines where SQLite isn't installed. Apparently about
half of the testing machines don't have SQLite installed in the test
environment unless you specify it as a dependency (which clearly
wouldn't be the right thing to do).
Incidentally, I learned a lot from reading your code. It's really
cleverly written.
This module is a prerequisite for Email::Storage, which is how I came
across it. I'd appreciate it if you could update - or I can if you
don't want to bother. I want to use Email::Storage, possibly eventually
in a product even. (Although at the speed I work, we'll all have brain
interfaces to the cloud by then and email will be long obsolete.)