Skip to content

Commit

Permalink
added (failing) test for cleanText()
Browse files Browse the repository at this point in the history
The cleanText function is supposed to convert DOS to Unix lineendings
but it seems that it doesn't always do that correctly as this thread
suggests: http://forum.dokuwiki.org/thread/8141

I added a unit test that currently fails but haven't found the real
cause yet. Further testing (and a fix) is needed.
  • Loading branch information
splitbrain committed Mar 13, 2012
1 parent c9f847f commit 9e760ee
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions _test/cases/inc/common_cleanText.test.php
@@ -0,0 +1,31 @@
<?php

require_once DOKU_INC.'inc/init.php';
require_once DOKU_INC.'inc/common.php';

class common_clientIP_test extends UnitTestCase {

function test_unix(){
$unix = 'one
two
three';

$this->assertEqual($unix,cleanText($unix));
}

function test_win(){
$unix = 'one
two
three';
$win = 'one
two
three';
$this->assertNotEqual($unix,$win);
$this->assertEqual($unix,cleanText($win));
}
}

//Setup VIM: ex: et ts=4 :

0 comments on commit 9e760ee

Please sign in to comment.