Permalink
Browse files

Merge pull request #480 from hans-d/fix_win_eol

Fix win eol - part 2
  • Loading branch information...
2 parents 0816a2b + 24cc20b commit 0697150b9fcc9135898eeecb274086b06541cb74 @nateabele nateabele committed May 24, 2012
Showing with 15 additions and 3 deletions.
  1. +15 −3 tests/cases/g11n/catalog/adapter/CodeTest.php
@@ -160,10 +160,22 @@ public function testReadMessageTemplateTNoEscaping() {
$expected = 'escaping\r\n3';
$result = $results['escaping\r\n3']['ids']['singular'];
$this->assertEqual($expected, $result);
+ }
- $expected = "escaping\n\t4";
- $result = $results["escaping\n\t4"]['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);
+
+ $expectedLR = "escaping\n\t4";
+ $expectedCRLF = "escaping\r\n\t4";
+ $resultLR = $results["escaping\n\t4"]['ids']['singular'];
+ $resultCRLF = $results["escaping\r\n\t4"]['ids']['singular'];
+ $this->assertTrue($expectedLR === $resultLR || $expectedCRLF === $resultCRLF);
}
public function testReadMessageTemplateTnSimple() {

0 comments on commit 0697150

Please sign in to comment.