fsavigny has asked for the wisdom of the Perl Monks concerning the following question:
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:
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: is (from Test::More) fails although strings should (no: must!) be equal
by choroba (Cardinal) on Jul 26, 2013 at 10:57 UTC | |
by fsavigny (Novice) on Jul 26, 2013 at 12:08 UTC | |
Re: is (from Test::More) fails although strings should (no: must!) be equal
by rjt (Curate) on Jul 26, 2013 at 10:58 UTC | |
Re: is (from Test::More) fails although strings should (no: must!) be equal
by daxim (Curate) on Jul 26, 2013 at 10:58 UTC |