On Fri, 18 Jan 2008 11:54:18 -0800 "Sean McAfee" <[EMAIL PROTECTED]> wrote:
> ok( $text =~ /"back is " . '#ffffff'/, 'col.back folded' ); > > The problem here is that the matching is performed in list context, so if it > fails, ok receives only a single argument, the string 'col.back folded', > which is true. So, this test can never fail. The solution is either to add > a $$ prototype to Template::Test::ok or ensure that tests that involve > pattern matches are always performed in scalar context. I think prototypes > aren't generally a good idea, so I'd go for the latter approach. Isn't this what like() is for? like( $text, qr/"back is " . '#ffffff'/, 'col.back folded' ); -- Paul "LeoNerd" Evans [EMAIL PROTECTED] ICQ# 4135350 | Registered Linux# 179460 http://www.leonerd.org.uk/ -- Paul "LeoNerd" Evans [EMAIL PROTECTED] ICQ# 4135350 | Registered Linux# 179460 http://www.leonerd.org.uk/
signature.asc
Description: PGP signature
_______________________________________________ templates mailing list templates@template-toolkit.org http://mail.template-toolkit.org/mailman/listinfo/templates