I am using Test::More to test a function that produces error messages (which are quite long - don't get distracted by the content of the one tested here!) Here, I am simply testing whether the output looks as it should:
is( $returned_message, $expected, 'expected_error_message');
As far as I am concerned, the output looks right, but is says it isn't.
I am sure this must be some very stupid oversight on my part, but I can't seem to figure out where. If you have a look at this snippet of output:
not ok 8 - expected_error_message # Failed test 'expected_error_message' # got: ' # esis2sth: Fatal runtime error triggered in #testelement->#testevent # Bad thing # What triggered this in your code should be in this line in foo.es +s: # 11 Line 11 of the code # [Input from: test.sgml, line 127] # ' # expected: ' # esis2sth: Fatal runtime error triggered in #testelement->#testevent # Bad thing # What triggered this in your code should be in this line in foo.es +s: # 11 Line 11 of the code # [Input from: test.sgml, line 127] # '
can you indentify any difference between got and expected?
It's not only that I cannot see the difference between got and expected, but I have also tried copying the strings between the single quotes into files and then diff'ing these files: no difference.
I am new to testing (but not to Perl), so I hope this problem is somehow familiar to somebody...
Many thanks for any help!!
t get distracted by the content of the one tested here!) Here, I am simply testing whether the output looks as it should:| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |