Repository navigation
assertEquals fails #10
Copy link
Copy link
Closed
Description
At line 172 of Test.java file there's an "assertEquals" failing.
This is the expected:
{"cook_time":"3 hours","name":"bread","tagName":"recipe","childNodes":[{"tagName":"title","childNodes":["Basic bread"]},{"amount":8,"unit":"dL","tagName":"ingredient","childNodes":["Flour"]},{"amount":10,"unit":"grams","tagName":"ingredient","childNodes":["Yeast"]},{"amount":4,"unit":"dL","tagName":"ingredient","state":"warm","childNodes":["Water"]},{"amount":1,"unit":"teaspoon","tagName":"ingredient","childNodes":["Salt"]},{"tagName":"instructions","childNodes":[{"tagName":"step","childNodes":["Mix all ingredients together."]},{"tagName":"step","childNodes":["Knead thoroughly."]},{"tagName":"step","childNodes":["Cover with a cloth, and leave for one hour in warm room."]},{"tagName":"step","childNodes":["Knead again."]},{"tagName":"step","childNodes":["Place in a bread baking tin."]},{"tagName":"step","childNodes":["Cover with a cloth, and leave for one hour in warm room."]},{"tagName":"step","childNodes":["Bake in the oven at 180(degrees)C for 30 minutes."]}]}],"prep_time":"5 mins"}
and this is the actual one:
{"cook_time":"3 hours","childNodes":[{"childNodes":["Basic bread"],"tagName":"title"},{"unit":"dL","childNodes":["Flour"],"tagName":"ingredient","amount":8},{"unit":"grams","childNodes":["Yeast"],"tagName":"ingredient","amount":10},{"state":"warm","unit":"dL","childNodes":["Water"],"tagName":"ingredient","amount":4},{"unit":"teaspoon","childNodes":["Salt"],"tagName":"ingredient","amount":1},{"childNodes":[{"childNodes":["Mix all ingredients together."],"tagName":"step"},{"childNodes":["Knead thoroughly."],"tagName":"step"},{"childNodes":["Cover with a cloth, and leave for one hour in warm room."],"tagName":"step"},{"childNodes":["Knead again."],"tagName":"step"},{"childNodes":["Place in a bread baking tin."],"tagName":"step"},{"childNodes":["Cover with a cloth, and leave for one hour in warm room."],"tagName":"step"},{"childNodes":["Bake in the oven at 180(degrees)C for 30 minutes."],"tagName":"step"}],"tagName":"instructions"}],"tagName":"recipe","name":"bread","prep_time":"5 mins"}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
douglascrockford commentedon Jan 13, 2011
You might have noticed this statement at the top of Test.java:
So the basic junit stuff is simply inadequate. But it is very popular, so it must be a good thing.
Neurone commentedon Jan 13, 2011
Oh, I suspected it was a keys ordering related issue but I didn't noticed your comments at the top of the file. Anyway, if a case can't be tested, I think removing it at all will be a better solution. Or at least it could be isolated just to show a possible toString() method misunderstanding, because that single fault currently prevents following tests inside testJSON() method to be executed.
I noticed sarcasm in your words about JUnit also ^^ Why do you think it's not a good choice? You don't like TDD or JUnit in particular?
douglascrockford commentedon Jan 13, 2011
If it were any good, you would not have filed the original report.
Simplistic solutions are great when they work.
Merge pull request stleary#10 from FritzMock/master
Fix XML.unescape rejecting valid whitespace numeric character references