Andrew Ford wrote:
Andrew Ford wrote:
BTW any thoughts on how to test the raw md5 and sha1 methods. They
return raw binary strings and I don't really want to include such
strings as the expected output in my Template::Test data. What is a
relatively portable way to encode a binary string?
What I mean by this is that I want to have something like this in my
Template::Test test script:
--test--
[% USE Digest.MD5; text = 'xyzzy'; text.md5 | some_encoding; %]
--expect--
??????????????
such that the code generates output that only consists of printable
ASCII characters that I can then specify in the expect part.
Any suggestions would be welcome.
The easiest way would probably be to use url encoding.
http://www.template-toolkit.org/docs/plain/Manual/Filters.html#uri
-- Josh
_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates