Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

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:

In reply to is (from Test::More) fails although strings should (no: must!) be equal by fsavigny

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others romping around the Monastery: (4)
    As of 2014-09-02 05:05 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite cookbook is:










      Results (20 votes), past polls