Skip to content
Browse files

fix EOL in g11n CodeTest

  • Loading branch information...
1 parent b338b7f commit 931776928727d9e9702bf874cd6fbf0eaba8b7c6 @hans-d hans-d committed
Showing with 13 additions and 2 deletions.
  1. +13 −2 tests/cases/g11n/catalog/adapter/CodeTest.php
View
15 tests/cases/g11n/catalog/adapter/CodeTest.php
@@ -160,10 +160,21 @@ public function testReadMessageTemplateTNoEscaping() {
$expected = 'escaping\r\n3';
$result = $results['escaping\r\n3']['ids']['singular'];
$this->assertEqual($expected, $result);
+ }
+
+ /**
+ * Due to different EOL handling on linux and windows, combined with
+ * the git config core.autocrlf setting, the test file may be written
+ * with either LF or CRLF as line endings, which has an effect on the
+ * key where the data is stored.
+ */
+ public function testReadMessageTemplateTNoEscapingLineEnding() {
+ $results = $this->adapter->read('messageTemplate', 'root', null);
$expected = "escaping\n\t4";
- $result = $results["escaping\n\t4"]['ids']['singular'];
- $this->assertEqual($expected, $result);
+ $resultLR = $results["escaping\n\t4"]['ids']['singular'];
+ $resultCRLF = $results["escaping\r\n\t4"]['ids']['singular'];
+ $this->assertEqual($expected, $resultLR || $resultCRLF);
}
public function testReadMessageTemplateTnSimple() {

0 comments on commit 9317769

Please sign in to comment.
Something went wrong with that request. Please try again.