Skip to content
This repository

Fix win eol - part 2 #480

Merged
merged 2 commits into from about 2 years ago

2 participants

Hans Donner Nate Abele
Hans Donner
hans-d commented

fix EOL in g11n CodeTest

Nate Abele
Owner

That assert should be $this->assertTrue($expected === $resultLR || $expected === $resultCRLF).

Nate Abele nateabele merged commit 0697150 into from
Nate Abele nateabele closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 15 additions and 3 deletions. Show diff stats Hide diff stats

  1. +15 3 tests/cases/g11n/catalog/adapter/CodeTest.php
18 tests/cases/g11n/catalog/adapter/CodeTest.php
@@ -160,10 +160,22 @@ public function testReadMessageTemplateTNoEscaping() {
160 160 $expected = 'escaping\r\n3';
161 161 $result = $results['escaping\r\n3']['ids']['singular'];
162 162 $this->assertEqual($expected, $result);
  163 + }
163 164
164   - $expected = "escaping\n\t4";
165   - $result = $results["escaping\n\t4"]['ids']['singular'];
166   - $this->assertEqual($expected, $result);
  165 + /**
  166 + * Due to different EOL handling on linux and windows, combined with
  167 + * the git config core.autocrlf setting, the test file may be written
  168 + * with either LF or CRLF as line endings, which has an effect on the
  169 + * key where the data is stored.
  170 + */
  171 + public function testReadMessageTemplateTNoEscapingLineEnding() {
  172 + $results = $this->adapter->read('messageTemplate', 'root', null);
  173 +
  174 + $expectedLR = "escaping\n\t4";
  175 + $expectedCRLF = "escaping\r\n\t4";
  176 + $resultLR = $results["escaping\n\t4"]['ids']['singular'];
  177 + $resultCRLF = $results["escaping\r\n\t4"]['ids']['singular'];
  178 + $this->assertTrue($expectedLR === $resultLR || $expectedCRLF === $resultCRLF);
167 179 }
168 180
169 181 public function testReadMessageTemplateTnSimple() {

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.