[wp-trac] [WordPress Trac] #62110: AtomParser_Parse_Test::test_parse_sets_handlers failing
WordPress Trac
noreply at wordpress.org
Mon Sep 30 20:56:26 UTC 2024
#62110: AtomParser_Parse_Test::test_parse_sets_handlers failing
------------------------------+---------------------
Reporter: benniledl | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 6.7
Component: Build/Test Tools | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
------------------------------+---------------------
Comment (by jrf):
For the record: I created the test while running on Windows and now they
are committed, they still pass for me on Windows too.
A brainfart just made think of line ending differences though, so I just
to did a test run converting the fixture file line endings to CRLF and
hey, presto, I can see the test failing, but just and only on the
`$atom->cdata_call_counter` related assertion.
Changing that assertion to something like `$this->assertGreaterThan( 56,
$atom->cdata_call_counter, sprintf( $msg, 'cdata' ) );` makes it pass
again for me and makes the complete test pass again too.
@benniledl @SergeyBiryukov Could you both check how you do your git check-
out on Windows ? If you both use `core.autocrlf = true` instead of
`core.autocrlf = input`, that would explain at least that difference.
Still doesn't explain the other differences though.
Having said that, it does confirm that - at least for this part - this is
a pre-existing issue, which just never was discovered because there were
no tests covering the code.
I imagine we may be able to do some line ending normalization before
parsing the feed (or during). Then again, if the handlers deal with
"empty" nodes correctly, we could also treat this as a test-only issue and
change the relevant assertions from `assertSame()` to
`assertGreaterThan()` as - after all - this test is just about verifying
that the handlers get called, not about testing the functionality of the
handlers.
But before we take any decision, I think it would be good to discover the
underlying cause for the other failing tests, so let's start with checking
the `core.autocrlf` setting and verifying that if that is set to `input`
while on Windows, the tests pass. If they still don't pass, we need to dig
deeper.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62110#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list