Maybe it's because it's Friday afternoon but my brain is refusing to
tell me what I've done wrong here. I'm trying to install TT 2.14 on a
newish box and it's failing in dbi.t, both in the CPAN shell and if I
run dbi.t directly:
suse3:~/.cpan/build/Template-Toolkit-2.14 # perl t/dbi.t
1..63
ok 1 - running test_expect()
ok 2 - template processor is engaged
ok 3 - input read and split into 30 tests
ok 4 - template text 1 processed OK: [% USE DBI -%]\n[% DBI.connect(ds...
ok 5 - template text 1 matched expected
ok 6 - template text 2 processed OK: [% USE dbi -%]\n[% dbi.connect(ds...
ok 7 - template text 2 matched expected
ok 8 - template text 3 processed OK: [% USE db = DBI -%]\n[% db.connec...
ok 9 - template text 3 matched expected
ok 10 - template text 4 processed OK: [% USE db = DBI(data_source => d...
ok 11 - template text 4 matched expected
ok 12 - template text 5 processed OK: [% USE dbi -%]\n[% dbi.connect(ds...
ok 13 - template text 5 matched expected
Template process failed: DBI error - DBI connect failed: Can't connect
to MySQL server on 'test' (113)
FAILED 14: - template text 6 process FAILED: [% USE dbi -%]\n[%
dbi.connect(da...
not ok 14 - template text 6 process FAILED: [% USE dbi -%]\n[%
dbi.connect(da...FAILED 15: - (obviously did not match expected)
not ok 15 - (obviously did not match expected)
ok 16 -
<snip> all other tests are OK
I don't understand the error message. It seems like it's interpreting my
database name, user name or password (which are all 'test') as a host
name ???
FWIW, this test is:
-- test --
[% USE dbi -%]
[% dbi.connect(database=dsn, user=user, pass=pass ChopBlanks=1) -%]
[% FOREACH user = dbi.query("SELECT name FROM usr WHERE id='abw'") -%]
* [% user.name %]
[% END %]
-- expect --
* Andy Wardley
I don't see anything wrong with the test, which is much like a previous
one that works. I haven't found anything relevant on the mailing list
archive. Does anybody have any idea what the problem is?
Thanks, Dave
_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates