Thomas Broyer wrote:
> 2007/5/31, Sam Ruby:
>> I believe I found an error in test_serialize that causes four tests to
>> be marked as passing when the serialized result obtained is not in the
>> list of expected results.
>
> No, actually, that was supposed to be a feature ;-)
>
> Considering that serializing without omitting option tags has no bug
> (which should be proved by other tests in core.test for example), this
> allows us to only include the expected possible results *with optional
> tags omitted* in the test's "expected" list.
I would buy that, if that were what the test code actually did. But I
found a bug where (previously) if the value had a single quote in it but
no double quote in it, and use_best_quote char was set, it would chose
to use single quotes instead of double quotes.[1]
It bothered me that this wasn't caught in the unit tests, but when I
looked closer, there were tests for this. So I looked closer. Here's
what the test code looked like:
> if result not in expected:
> if options.get("omit_optional_tags", True):
> options["omit_optional_tags"] = False
> self.assertEquals(self.serialize_html(input, options), result)
> else:
> result = self.serialize_html(input, options)
Paraphrased, this says "if the result is not expected, try again with
omit_optional_tags=false and verify that you get the SAME unexpected result"
Is this what you really intended?
Changing the test code to say "if the result is not expected, try again
with omit_optional_tags=false and see if the result you obtain on the
second attempt is in the expected list" produces 18 failures.
- Sam Ruby
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"html5lib-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/html5lib-discuss?hl=en-GB
-~----------~----~----~----~------~----~------~--~---