cygri / htmldiff

A command-line script that shows text changes between two HTML files
MIT License
61 stars 27 forks source link

test failing #1

Open onassar opened 11 years ago

onassar commented 11 years ago

Hey there. I ran ./htmldiff test and got the following: http://cl.ly/image/2g0W3Y2c3S19

Do you think these tests failing could be related to my python version (2.7.3)?

onassar commented 11 years ago

ping?

edsu commented 10 years ago

Tests failing are the result of the changes that have happened since the original was updated. Those tests pass with python 2.7.5.

You can roll back your repo and see this if you want:

git checkout 545ef97bfb00602acb8d60c0466b7e5e7283ee7d
./htmldiff test

the second commit a18f852427cd538375ef7063c0d29671557e387a is when tests started to fail:

git checkout a18f852427cd538375ef7063c0d29671557e387a
./htmldiff test
**********************************************************************
File "./htmldiff", line 168, in __main__.htmldiff
Failed example:
    htmldiff('test1', 'test2')
Expected:
    '<span class="delete">test1 </span> <span class="insert">test2 </span> '
Got:
    '<span class="delete">test1</span><span class="insert">test2</span>'
**********************************************************************
File "./htmldiff", line 170, in __main__.htmldiff
Failed example:
    htmldiff('test1', 'test1')
Expected:
    'test1 '
Got:
    'test1'
**********************************************************************
File "./htmldiff", line 172, in __main__.htmldiff
Failed example:
    htmldiff('<b>test1</b>', '<i>test1</i>')
Expected:
    '<span class="tagDelete">delete: <tt>&lt;b&gt;</tt></span> <span class="tagInsert">insert: <tt>&lt;i&gt;</tt></span> <i> test1 <span class="tagDelete">delete: <tt>&lt;/b&gt;</tt></span> <span class="tagInsert">insert: <tt>&lt;/i&gt;</tt></span> </i> '
Got:
    '<i>test1</i>'
**********************************************************************
File "./htmldiff", line 205, in __main__.simplehtmldiff
Failed example:
    simplehtmldiff('test1', 'test2')
Expected:
    '-[test1 ]+[test2 ]'
Got:
    '-[test1]+[test2]'
**********************************************************************
File "./htmldiff", line 207, in __main__.simplehtmldiff
Failed example:
    simplehtmldiff('<b>Hello world!</b>', '<i>Hello you!</i>')
Expected:
    '-[<b>]+[<i>]<i> Hello -[world! ]-[</b>]+[you! ]+[</i>]</i> '
Got:
    '-[<b>]+[<i>]<i>Hello -[world!]-[</b>]+[you!]+[</i>]</i>'
**********************************************************************
2 items had failures:
   3 of   3 in __main__.htmldiff
   2 of   2 in __main__.simplehtmldiff
***Test Failed*** 5 failures.
cygri commented 10 years ago

Yeah, I must admit that I completely ignored the tests when updating the code. The test failures actually all show behaviour that I would call correct, according to the whitespace and markup handling changes I made. So the tests need fixing, not the code.

edsu commented 10 years ago

I thought it was mostly whitespace changes too, but one of the test failures gave me pause:

File "./htmldiff", line 236, in __main__.simplehtmldiff
Failed example:
    simplehtmldiff('<b>Hello world!</b>', '<i>Hello you!</i>')
Expected:
    '-[<b>]+[<i>]<i> Hello -[world! ]-[</b>]+[you! ]+[</i>]</i> '
Got:
    '<i>Hello -[world!]-[</b>]+[you!]+[</i>]</i>

Isn't there a missing <b> in the actual output as compared with the expected output?