Make WordPress Core


Ignore:
Timestamp:
10/29/2019 02:26:41 PM (7 years ago)
Author:
SergeyBiryukov
Message:

Build/Test Tools: Ignore EOL differences in tests using multiline string assertions.

Unix vs. Windows EOL style mismatches can cause misleading failures in tests using the heredoc syntax (<<<) or multiline strings as the expected result.

Fixes #31432. See #42594, #47411.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/pomo/po.php

    r46586 r46612  
    2323http://wordpress.org/
    2424';
     25                $this->mail    = str_replace( "\r\n", "\n", $this->mail );
    2526                $this->po_mail = '""
    2627"Your new WordPress blog has been successfully set up at:\n"
     
    6465                $this->assertEquals( '"Categories can be selectively converted to tags using the <a href=\\"%s\\">category to tag converter</a>."', $po->poify( $src ) );
    6566
    66                 $this->assertEquals( $this->po_mail, $po->poify( $this->mail ) );
     67                $this->assertEqualsIgnoreEOL( $this->po_mail, $po->poify( $this->mail ) );
    6768        }
    6869
     
    7576                // wordwrapped
    7677                $this->assertEquals( 'babadyado', $po->unpoify( "\"\"\n\"baba\"\n\"dyado\"" ) );
    77                 $this->assertEquals( $this->mail, $po->unpoify( $this->po_mail ) );
     78                $this->assertEqualsIgnoreEOL( $this->mail, $po->unpoify( $this->po_mail ) );
    7879        }
    7980
     
    8990                        )
    9091                );
    91                 $this->assertEquals(
     92                $this->assertEqualsIgnoreEOL(
    9293                        'msgid "baba"
    9394msgid_plural "babas"
     
    102103                        )
    103104                );
    104                 $this->assertEquals(
     105                $this->assertEqualsIgnoreEOL(
    105106                        '#  baba
    106107#  dyado
     
    115116                        )
    116117                );
    117                 $this->assertEquals(
     118                $this->assertEqualsIgnoreEOL(
    118119                        '#. baba
    119120msgid "baba"
     
    128129                        )
    129130                );
    130                 $this->assertEquals(
     131                $this->assertEqualsIgnoreEOL(
    131132                        '#. baba
    132133#: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
     
    159160                        )
    160161                );
    161                 $this->assertEquals(
     162                $this->assertEqualsIgnoreEOL(
    162163                        'msgid "baba"
    163164msgid_plural "babas"
     
    173174                        )
    174175                );
    175                 $this->assertEquals(
     176                $this->assertEqualsIgnoreEOL(
    176177                        'msgid "baba"
    177178msgid_plural "babas"
     
    191192                        )
    192193                );
    193                 $this->assertEquals(
     194                $this->assertEqualsIgnoreEOL(
    194195                        '#, fuzzy, php-format
    195196msgctxt "ctxt"
Note: See TracChangeset for help on using the changeset viewer.